How to restore FollowerEntity velocity?

  • A* version: 5.3.3
  • Unity version: 6000.0.43f1

Hi,
I’m using FollowerEntity to control character movement, and struggling to restore the velocity when loading the saved data.
Is there a proper method to set FollowerEntity velocity directly?
Thank you.

I’m thinking this is related to setting a Movement Override. But specifically changing the velocity to just be restored to what it was on save is throwing me for a loop. I can change the speed no issue really, but that requires at least momentarily changing smoothing to 0 and stuff like that, so it’s not really what I was trying to accomplish :thinking:

Gonna tag @aron_granberg on this one for some more info~

Hi

You’ll want to restore this in the ResolvedMovement ECS component.

ai.enabled = true;
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.SetComponentData(ai.entity, new Pathfinding.ECS.ResolvedMovement {
		speed = ...
});

There’s no built-in accessor for this at the moment.

1 Like