Skydiving System HOW TO

  1. Hello there! I’ve been at this question for mutiple days now. I am looking the create a skydiving system without a lot of math. When it comes to math realted to developing, I’m not the best at it. I want to keep the system simple and here are a few things I have in mind for the system. (1) You can skydive faster when moving around. (2) Your body can be rotated and follows the camera. If someone could help me brainstorm these things I’d appriciate it!

NOTE: I am not asking for you to make me a system, I just need ideas so I can brainstorm how to make the system.

7 Likes

Basically what you want to do is create whats called assignment vectors. Basically what we do is we create an imaginary vector point in a sense from the players cameras look vector and camera. What this basically means is we have a point in space which is a x offset of our players head with respective rotation to camera. From there we can get the vector from our new imaginary point and our camera and then align that with our players up vector (assuming u want them going head first). But how do we align those? In a sense we get the delta difference of the vectors then apply that to a spherical linear interpolation (quaternions) I have left a game example where I use this method to align the players feet with the sphere (in this case the sphere would be our camera). faux.rbxl (22.3 KB)

4 Likes

Wouldn’t it be simpler to just use an animation?

2 Likes

This is how I did it. I adjust the walk speed to control X Z (horizontal) motion, increasing speed as the player tries to guide the fall in a direction. I play animations based on whether they are guiding the fall or not. I control fall speed with a vectorforce in the humanoid.

It is a very simple ‘unmath’ way to do it, but it works and players seem to enjoy it, you can try it in my game:
https://www.roblox.com/games/1930884113/Aerobatic-Flying-Skydive

1 Like

How would i adjust the walkspeed to control X Z motion? Isn’t X Z a Vector2 value? Do you have a cpde sample I could use?

1 Like

You just set the walk speed. It automatically controls X and Z, if the player ‘walks’ in the air while in the freefall state, he will move in a direction at the walk speed. So by default they can control their direction in fall, it just doesn’t move much at the default 16 walk speed.

Ahh I see, I really really like really enjoy your game. Is simple and really nice. I really like the glider system and I am trying to achieve making that, but without the glider ofc. So may I ask how you slow the player down during freefalling then speed the fall back up when they are “walking” in the air?

idk animations arent dynamic :rofl:

Thanks. I don’t speed up the fall when they are moving, just the lateral (walk) speed, the freefall remains constant, although I randomize the fall a bit so players may not fall at the exact same speeds, but they maintain their fall speed until they splat or otherwise put out their glider. I randomize the speed to add some variety and because its pretty cool to fall with a friend and be able to see them fall way from you slowly and skirt about quickly laterally as they move.

Ah I see, so is is just a matter of using the skydiving animation and playing around with the walk speed?

Yes, and adding the vector force in the up direction to make them fall slower (and deleting that when they are done falling). This is kind of like the wind resistance, pushing them up so they reach a constant terminal velocity and not keep accelerating to infinite speed.

6 Likes

Alright, I understand now. Thank you so much for helping me out!

I just wanted to clarify something, I reviewed my code and I actually used BodyVelocity vs VectorForce. VectorForce could add a little complication so I wanted to clarify that.

BodyVelocity should simplify things since you just set the velocity you want and it will maintain it.

I think they want devs to get away from that and use vectorforce, maybe I’ll convert mine at some point.

Good luck!

Ah I see, if I were to use BodyVelocity, what would I set the x,y,z velocity values to? And what is the best Max Force.

1 Like

That depends on how fast you want to fall, so you’d use (0, -fallvelocity, 0)

This YT video for setting up a simple slow fall should really help you see how it works.

2 Likes

May I ask something? How did you handle the animation? I was thinking of making a free fall animation and changing the player’s idle animation to the free fall animation. That way when the player is not moving around, it plays the free fall animation. I will also be making a diving animation and put that into the walk animation so that when the character moves, it plays the animation. Do you think this is a good approach?

Yes, just make your animations Actions so they override the default stuff and you don’t have to worry about changing the defaults.

This is what I have right now and is really bad. :confused:

Why isnt it changing the fall anim to the second anim even though I stopped moving? 
local plr = game.Players.LocalPlayer

chr = plr.Character or plr.CharacterAdded:Wait()

local RunService = game:GetService("RunService")

local function updateSkydiveAnim()
	if chr then
		if chr.Humanoid.MoveDirection.Magnitude > 0 then
			chr.Animate.fall.FallAnim.AnimationId = "rbxassetid://6214558611"
		end

		if chr.Humanoid.MoveDirection.Magnitude <= 0 then
			chr.Animate.fall.FallAnim.AnimationId = "rbxassetid://6214532059"
		end
	end
end

-- Update the effect on every single frame.
RunService.RenderStepped:Connect(updateSkydiveAnim)

https://gyazo.com/4b876977b23036cd6007fec18e9b4e8a

I don’t know if this is close to the thing you want to do

1 Like

Yes, I alredy have that, but what I am trying to achieve is wheb the character moves in a direction while falling, I want it to player a diving animation. But if they dont move around and just stay still, then I want it to be a free fall. As you can see, I made a code above and the free fall works but when i move in a direction it plays the animation but then when I still stay, it still plays the diving animation. You can take a look at the gyoza gif.