Support Forum

How to make AI move faster or slower as expected?

Hey!I use the keyboard to control the movement of my character with recast graph. When I press the direction key, I set the destination to a fixed distance in the front direction of the current character.

I set the RichAI’s max speed to 20, the acceleration to 100 and the rotation speed to 1000 then it takes 3.5 seconds to pass a test distance.

At this time, I set the max speed to 10000, and the passing time does not seem to change.

Then I continued to set the acceleration to 200, and the time to pass the same test distance became 2.5 seconds.

I am very confused about this. How can I set it to accurately control the speed of AI? For example, when the game is running, how to suddenly make the speed of AI double. Can someone help me?

1 Like

Hi

The AIPath/RichAI movement scripts always accelerate. They are not good options if you want to change the speed of the character instantaneously. The AILerp script does not use acceleration and may work for you, though of course that script has a lot of other changes that may not be suitable for your game.
See Documentation

You can also write your own movement script with exactly the behaviour you want: Documentation