ProceduralGraphMover teleport FollowerEntity after update to 5.4.4

Hi,

The game uses a ProceduralGraphMover that follows the player. When loading, simulateMovement is set to false for all FollowerEntity objects. When a FollowerEntity is on the graph, simulateMovement is set to true, and at that moment the FollowerEntity teleports to a random point. Forcing the position doesn’t help. How can I make the FollowerEntity objects start moving when they are on the graph and stop when the graph leaves them? Everything worked in version 5.3.8.

The code

void UpdateCanMove()
{
   if (_onGraph == onGraph)
      return;

   _onGraph = !_onGraph;
   if (_onGraph)
      _followerEntity.position = transform.position;

   _followerEntity.simulateMovement = _onGraph;
   _followerEntity.updatePosition   = _onGraph;

   if (_onGraph)
      _followerEntity.position = transform.position;
}
  • A* version: 5.4.4
  • Unity version: 6000.2.9f

What’s your usecase for this part? Trying to get a better idea of why they’re off in the first place so I know what may or may not work.

The game features an infinite world divided into sectors that load as the player moves. To improve performance, ProceduralGraphMover doesn’t cover the entire loaded world area. If you don’t set simulateMovement to false , mobs will immediately teleport from their positions to the graph. I want them to remain in their positions until the graph reaches them, and then freeze in their positions when the graph leaves them.

1 Like

You can work around this with FollowerEntity.Teleport

I’m reading up on simulateMovement and I’m wondering if they’re holding “old movement data” from before they are disabled. When is this UpdateCanMove() called? Early enough so that they don’t start a movement? If this is the case you may want to also try using isStopped instead

1 Like

Teleport works! You also need to clear the destination (set it equal to the current position) so that it doesn’t start moving when you turn it on.

Thank you!

1 Like