"Slow motion" (delta time manipulation) with `FollowerEntity`

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

I would like to have some programmatic control over the timestep that is being used by the FollowerEntity when it is calculating it’s update.

It doesn’t seem to use the standard Unity Physics simulation as it’s basis for when to run a step.

It does it’s own thing regardless of me using

Physics.simulationMode = SimulationMode.Script;
Physics2D.simulationMode = SimulationMode2D.Script;

and then calling

float SimFixedDeltaTime = Time.deltaTime * simTimeScale; // simTimeScale is a float e.g. 0.75f
Physics2D.Simulate(SimFixedDeltaTime);
Physics.Simulate(SimFixedDeltaTime);

to adjust the timescale at run time.

It’s not surprising as it’s running on ECS but I wonder if i’m missing some variable or simple option where I could implement this.

Hi

It uses the unity standard Time.timeScale.

Thankyou for the quick response. I may be overcomplicating things and missing an easy win but I think Time.timeScale is too “global” a control for my purposes.

If I wanted to have a grenade that causes an area of time distortion I would need units within that area to be slowed down without the units outside of it being.

If I needed to create a custom class to achieve this, which component(s) would I need to extend?

In that case I would recommend that you modify the agent’s speed, rotation speed and other input values that would be affected by time scale.
There’s no non-global time scale field that the FollowerEntity uses, I’m afraid.