I want to make a player script for flying, controls like you are in roblox terrain water, but without the water.
Exactly like they did it in the City of Rolantis game, same controls and movement.
Space to ascend up, A and D for swimming left and right, W and S for moving forward and backward in the direction you are facing. with different animations for Idle, movement, and ascending (i plan on using it for both swimming in a water world like Rolantis, and jetpack flight in space/zero gravity)
how do i make something like this?
Hi, I was one of the main developers on the team for Rolantis.
We accomplished the swimming by reimplementing it entirely ourselves. For all of our animations, we had a walking and swimming variant. When the player was swimming, we should switch to our swimming animations instead of the walking ones.
We also made our own character controller to replace the default Roblox one. You can get the required information from the Humanoid object (mainly, the direction the player wants to be moving in).
When the player was in swim mode, we would activate a BodyVelocity inside of the character which completely controls the velocity of an assembly, ignoring gravity.
We used a spring solver to determine the player's current velocity in time, so as to smooth the player into full speed and back to rest when they press and release the movement keys. Tuning the spring's dampening gave the most convincing illusion of an underwater swimming effect.
Unfortunately, pulling something like this off is not simple. I wouldn't necessarily call it hard, but there's a lot of steps involved. To recap: