Рет қаралды 26,391
DROP ANCHOR!
Today we are building some underwater physics and movement for our player character in Game Builder Garage. The crux of this method relies on using a moving object to counterbalance the fall of the player character and create slow underwater-like gravity. Once that is set in place we move on to implementing an upwards swim stroke, downward dive, jumping out of a body of water, and a forward water-dash.
What I like is that all of the physical forces are being applied to the moving object box so you could attach this to any kind of player character (or enemy or NPC) that has basic directional movement already in place.
There are several things you adjust by means of a few constants. The move speed underwater, the force of each swim move, water-emergence jump force, and the distance and timing of the water dash are all adjustable.
Chapters
00:00 Intro
00:10 What we’re going for
00:18 Slow falling / Underwater gravity
01:07 Determining When Underwater
02:05 Slow Down Underwater Movement
02:41 Entering Water Effects
03:15 Upwards Swim Stroke\
03:57 Downward Dive
04:32 Emerging from Water Boost
05:08 Forward Water Dash
06:46 FiNaLLy
06:50 Download Code
06:56 Outro
Questions, suggestions, requests? Let me know in the comments.
Thanks for watching,
have a lovely day!
#GameBuilderGarage #NintendoSwitch #WaterPhysics #Swimming
─────────────────
Game: Game Builder Garage
Genre: Programming Game
Platforms: Nintendo Switch
Developer: Nintendo
Publisher: Nintendo
Release Year: 2021
─────────────────