Navigation agent to rotate instantly
Hello,
I am trying to figure out how to increase the speed of NavMeshAgent rotation to being instant, so that the Agent would ALWAYS face the direction that he is moving.
For example if I click just 1unit away towards the objects back, then it would turn 180degrees instantly the moment he start moving. Changing the default values did not help as it would never rotate fast enough even with values of 999999 on angular speed and acceleration.
Thanks for help :)
If I remember correctly the rotation is actually faster with lower acceleration, give it a try. Or try to override the rotation editing transform component (lookAt). but I've never done it so cannot tell if this will work.
Answer by C_R_E_A_T_R_O_R · Sep 11, 2016 at 06:58 PM
I had the same problem with a very fast agent i was using. In order to make it work exactly as you want you should set the Angular Speed to 900 - 999 and make sure that the Acceleration is a little bit higher than the Speed (eg: Speed = 14, Acceleration = 17)
Omg, you're right man! I spent hours on this... But finally I realize that angular speed is calculated based on both speed and acceleration!
Answer by unity_w38HsBtci_B3xQ · Mar 01, 2021 at 03:28 PM
Set the Angular Speed and the Acceleration to infinity.
Doing this not only doesn't work, it will actually throw an exception.
By infinity, i think they mean a very high value
Even if that's the case, setting the value of these fields to a value that's too high (such that the value is displayed as an exponent) also throws an error. Anyway, even if you set the values to 99999, you won't be able to notice a difference between than and setting it to 5000, because the underlying functionality remains the same.
Your answer
Follow this Question
Related Questions
Why Is My Enemy Rotating On X? 0 Answers
Nav Mesh Agent radius next to my game object causing a deviation. 0 Answers
Rotation of a cube 0 Answers
How to lock X rotation on 3D object? 0 Answers
How to make platform to rotate player ? 0 Answers