May I know what's causing my forward and strafe speed to double only when I press the forward key together with a strafe key?
I forgot how to mod the original movement code, fixed it once but then dumped it for newer code someone made a sample for.
Exactly right, this is the situation:HWGuy wrote:There's a condition missing, when you press forward you move at 1x, and when you press strafe you move at 1x sideways, which combined is 1.4x diagonally.
The fix is simple: Just (re-)normalize, that is, scale back to unit length, the movement vector. As a result, all vectors will have length 1 and movement speed is the same in any direction.
Do you want to implement this yourself?
I can do it, too, but it's a nice exercise to get familiar with the code.
Iirc, it's the
HumanPlayer.cppthat represents the vector in the above image. I also seem to remember that someone had the same question before, not long ago, but at the moment, I cannot find the related thread.
In any case, if you want me to have another look at this, please let me know.
Users browsing this forum: No registered users and 0 guests