- A* version: 5.4.6
- Unity version: 6000.0.51f1
We speed up our game with a custom time scale in our own TimeManager, and it seems to me that the TimeScaledRateManager’s CustomTimeScale should help me speed up the FollowerEntitys’ movement. We use FollowerEntitys on a RecastGraph. When we set CustomTimeScale mid play session, the FollowerEntitys do move faster/slower, but when we
-
lower the CustomTimeScale (e.g. from 1 to 0.5) the pathfinding system visibly stops FollowerEntities for a moment
-
raise the CustomTimeScale (e.g. from 1 to 2) the pathfinding system completes current FollowerEntity paths immediately
My issue seems to be fixed by changing a line, but if I have misunderstood something, I would love to know. In AIMovementSystemGroup.ShouldGroupUpdate() I changed the following line:
var currentTime = group.World.Time.ElapsedTimeCustomTimeScale;
changed to
simulationElapsedTime += group.World.Time.DeltaTime * CustomTimeScale;
var currentTime = simulationElapsedTime;
and I added a private field to the AIMovementSystemGroup:
double simulationElapsedTime;