- Home /
Character controller speed problem
Im using a character controller for a first person character. I multiply my axis input with relative player directions and multiply that with speed and deltatime. So the proble shows up when I move diagonally I move faster as intended.
Answer by Rhombuster · Mar 29, 2017 at 06:12 PM
If you're using arrow keys, you may need to normalize your axis input. Look in to this:
https://docs.unity3d.com/ScriptReference/Vector3.Normalize.html
Your vector probably looks something like this (1, 0, 1) when debugging? What's happening is when you are pressing both, the length of your vector is sqrt(2). This is larger than pushing one key, which will give you a vector length of 1.
Let me know if this is not the issue.
You saved me man, thanks!
BTW, I understood why im getting a higher vector output when getting a combination like (1,0,1) but how does the normalization of the vector fix it? I see It did infact fix it but what happeneds to the vector itself as it's normalized?