Formula to obtain player speed for diagonal move?
mhedges
Raised on VCSMember Posts: 634
Hello -
How do I obtain the player's (or any other object, for that matter) speed when moving diagonally? I believe it has to use linear velocity for x and y, but I can't figure out how they are used in a formula.
Thanks, regards.
Comments
Nevermind.
a2 + b2 = c2
or
ObjectSpeed = sqrt( LinearVelocityXˆ2 + LinearVelocityYˆ2 )
My Blog / App Store / Google Play
Or, you could use the Magnitude function.
I think that would give the same result.
Best,
GSLearn.com | Templates | Free Demos | Udemy Course