FollowerEntity - very slow rotation to target & doesn't correct rotation toward destination if it moves

This video is worth a thousand words: https://youtu.be/E_6AtyG_EAY

Two related issues:

  1. When the FollowerEntity reaches the destination it slowly rotates to face it perfectly, rather than rapidly adjusting. I’ve maxed out the “Max On Spot Rotation Speed” to no effect. Seems like something else is going on. It looks to have a bit very slow “lerp” to face the target.

  2. When the destination moves around the FollowerEntity, it doesn’t rotate to face it. Instead, it remains facing the direction it used to be in. If the destination moves further away and requires movement to reach it, then it will rotate as expected.

Thank you for your advice on these two matters! I appreciate it.

An observation: even if I set “Allow On Spot Rotation” to false, the FollowerEntity will still demonstrate this slow lerping rotation described.

Hi

If you want to make the agent face a particular direction, you can use the ai.SetDestination(destination, facingDirection) overload. Otherwise, it will think any direction is as good as any other.
See FollowerEntity - A* Pathfinding Project

Thank you @aron_granberg , appreciate your reply. I have it working now, but I’m setting the transform.rotation directly. Is there any downside to setting the transform directly versus setting ai.SetDestination(…)?

I’d say if you’re not experiencing any issues from setting it directly, it should be fine :+1: I’ll let Aron be the voice of fact on that though. If you wanted to use something more “built-in”, The ai.SetDestination(destination, facingDirection) method mentioned earlier may be your best bet it looks like.

I’ll leave it as is, thank you.

1 Like