i currently have a linearvelocity that accelerates the player forward when theyre in the air, the problem with this is how if they move diagonally, they move significantly faster than how they would while moving straight forward.
Hi!! When a player moves diagonally, the MoveDirection vector is the result of combining two directions (forward + sideways), this will cause the overall magnitude of the vector to be greater (because it is a sum) than if the player were moving in a straight direction. You should normalize the MoveDirection vector, it will make sure that its magnitude is always 1, regardless of the direction.
Yeah, individual components are caped at 1. But when moving diagonally the X and Z axes contribute to the final velocity resulting in a magnitude greater than 1.
Example, moving forward might give a MoveDirection of (0, 0, 1) with a magnitude of 1
But moving diagonally (forward-right for example) might give a MoveDirection of (1, 0, 1) making the magnitude of this vector a √2. So when you multiply by the speed factor it will make diagonal movement faster.
I would avoid move direction altogether. You can accelerate them based on the direction they are looking. This is a much better system because it will accelerate them at the same speed regardless of the direction. You can learn how to do something like this in this article.
I am not supposed to be making the scripts for people. You need to learn how to do this yourself so you can understand how it works.