So I made a custom character controller that is physics-based (I mean BodyMovers) but when a player presses both keys (ex. W and D at the same time) while looking slightly to the sides, the character moves faster than just pressing W and looking at the goal.
Example:
1 Like
If you’re trying to keep the times the same, make sure you cap the maximum velocity the object is able to move regardless of direction.
If you haven’t solved this then there is a way.
What you can do is to separate the direction and the speed.
Velocity is a vector that takes in Velocity and Speed. Many people usually forget about this or do not know about it
There are two ways.
Make a direction and then make a speed and put them together.
direction should be a unit vector So here is the way.
local direction = Vector(1,0,0).Unit --<Here you put your direction you want the character to travel in and turn it into a UNIT>
local speed = 5 -- Here you put your speed.
local Velocity = speed * direction -- Here is how to combine them. Since speed is a scalar you are allowed to multiply it to a unit vector
After that simple plug the velocity into a body mover and viola
I recommend you use forces since BodyMovers are deprecated.
1 Like
I have found a workaround a while back, but this is definitely a better approach. Thanks!
1 Like