💡FAQ

v1.0

My Awake(), Update(), OnEnable() methods aren't executing

The MagicTimeUser class uses various Unity lifecycle events, and they are virtual. Make sure that your subclasses which derive from MagicTimeUser are properly overriding the methods, and calling "Base".

// --- MagicTimeUser.cs
protected virtual void Update()
{
    // NOTE: If this isn't firing, make sure you are not overriding Update in a subclass!!!
    
    HandleTransition();
}

// --- MyDerivedClass.cs (inherits from MagicTimeUser)
protected override void Update()
{
    // Generally call this first, and do checks like those below on each Update() if needed
    base.Update(); // This ensures that the Update() on the parent class is called

    if (!FullySetup) return;
    if (IsDead) return;
    
    // More Update() actions can go here...
}

The TimeScale never changes, but I see it changing in the Inspector

When the TimeScale is set to transition over time, make sure you are not setting the value every frame. This can happen when you have a slider or other method that itself transitions from one value to another.

The SetValue() method will start the transition, and if it is called every frame, then the transition curve will resolve to the 0 position, which often may be a value multiplier of 0, meaning the end result will not be modified.

If you want to utilize a slider or other transition external to the Transition values in the LocalTimeScale, set the Transition Duration to 0. This will ensure that the value provided in SetValue() is set immediately.

Last updated