• RuntimesUnity
  • SetTrigger fails after slowdown (Unscaled Time)

I'm developing a 2D action game using Unity × Spine.

When the player's HP reaches 0, I trigger a slow-motion effect by setting Time.timeScale = 0.1, then apply an impulse AddForce to knock the player back, followed by a transition to a "DeadDown" animation using SetTrigger("DeadDown").
The player's Animator component is set to Update Mode: Unscaled Time, so I expected the animation to proceed normally even during the slowdown.

However, the issue is:
・Ground detection (OnGround = true) works properly and a landing effect appears.
・But the animation transition via SetTrigger("DeadDown") does not occur — it's as if the Animator is frozen.
・Even though Unscaled Time is set, the Animator still seems to behave as if it’s affected by timeScale.

This is confusing because SetTrigger seems to fire (the debug log shows), but the animation state does not change until timeScale returns to normal.
Previously, I had a separate issue where root motion didn’t work until I added the Skeleton Mecanim Root Motion (Script). I’m wondering if this problem might also be related to a Spine-specific behavior.
Any help would be greatly appreciated!

  • Harald ответили на это сообщение.
    Related Discussions
    ...

    It seems like you're encountering an issue where the Animator component, despite being set to Unscaled Time, is not transitioning animations as expected when the global Time.timeScale is reduced. This could be due to how the Animator component interacts with Spine's Skeleton Mecanim or Skeleton Animation components. While you have set the Animator to use Unscaled Time, the Spine animation might still be influenced by the global time scale settings, especially if the animation state or track entry time scales are not set correctly.

    To address this, ensure that the SkeletonAnimation or SkeletonMecanim component is also set to use unscaled time if applicable. You might need to explicitly set the AnimationState.timeScale or TrackEntry.timeScale to 1 to ensure they are not affected by the global time scale. Additionally, verify that the SetTrigger method is correctly linked to the animation state transitions in your Animator Controller. If the problem persists, consider checking if there are any other scripts or conditions that might be interfering with the animation transitions during the slow-motion effect.

    Vein ・But the animation transition via SetTrigger("DeadDown") does not occur — it's as if the Animator is frozen.
    ・Even though Unscaled Time is set, the Animator still seems to behave as if it’s affected by timeScale.

    Which exact version of the spine-unity runtime (name of the unitypackage, also listed in Assets/Spine/version.txt, or in the Package Manager) are you using? There have been time-related issues in the past which have been fixed, so if not using the latest version, please check whether the issues are already resolved by using the latest package.