• Hey! Register here to create your account, engage with the community, and talk about what is new!

How to give players better air control?

onion_hq

New member
Joined
Dec 23, 2023
Messages
14
Reaction score
0
I'm making a movement-based game and want to improve the player movement by giving players better air control. Is there anyway to do this?
 

Jimmy_The_Knight

Well-known member
Joined
Dec 28, 2020
Messages
73
Reaction score
32
Hm this is an interesting question actually. You can make a double jump by enabling flight for the player, then immediately taking it away when they try to use it and launching them forward, then giving it back to them once they land on the ground, but you're probably looking for a way to give the players more power over horizontal movement mid-air just by using the arrow keys.

What I'd experiment with is taking the motion vector of the player, zeroing out its y value, and then pushing the player with vertical launches based on that vector. This is just an idea though, you'll probably have to tinker with it a lot to get the desired effect.
 
Last edited:

onion_hq

New member
Joined
Dec 23, 2023
Messages
14
Reaction score
0
Hm this is an interesting question actually. You can make a double jump by enabling flight for the player, then immediately taking it away when they try to use it and launching them forward, then giving it back to them once they land on the ground, but you're probably looking for a way to give the players more power over vertical movement mid-air just by using the arrow keys.

What I'd experiment with is taking the motion vector of the player, zeroing out its y value, and then pushing the player with vertical launches based on that vector. This is just an idea though, you'll probably have to tinker with it a lot to get the desired effect.
Don't you mean horizontal movement not vertical?

Also, how do I get the player's "motion vector"? Do you mean the Velocity option found in the Game Value item?
 

onion_hq

New member
Joined
Dec 23, 2023
Messages
14
Reaction score
0
Update: After some experimentation, I have a general idea of what I need to do. Firstly, I need to set a variable to a location that is a set distance from the player and in the direction they are moving in horizontally (I can visualize this point with a particle, so what I'd be looking for is to have this particle spiral around a circle if I were to move in a spiral), afterwards I just have to use a "Launch toward location" block with a small launch power.

Two issues though:
1. By using the particle, I can see that the chosen point is only at my feet. How do I make it go out to the chosen distance?
2. If I set the Launch toward as not adding to current velocity, the player doesn't fall, and if I set it to add then they just exponentially speed up. how can I set a maximum speed?
 

RodaballoXD

New member
Joined
Mar 18, 2024
Messages
29
Reaction score
2
To set a max speed, you could use get vector length, and if it's too high, (compare it with a number using the if variable block) use set vector length and give the player that speed. This isn't going to work either, the player isn't going to be able to change the direction they are moving, so you could do what Jimmy said, giving the players the double jump, or maybe you can experiment with giving the players fight mode (you can set their flight speed with set movement attribute) and apply some math to their Y coordinate vector so they go downwards.
 
Top Bottom