I'm curious as to how your character dies/re-spawns during a pause state if the entire game freezes during the pause state?
It's also generally not good practice in Unity to set Time.timeScale to 0 during run-time, because it can cause errors exactly like this one. I would recommend you find an alternative solution, for example freezing the movement of objects similar to how you set your character's locomotion time scale to 0.
If you absolutely must set Time.timeScale = 0, then you should set it back to 1 for at least a frame or two when re-spawning the character.
Hi, thanks for the reply.
Im using the built-in CharacterRespawner and Health components from Opsive. Health fires the death event, Respawner is scheduling a respawn after death. As for how the Scheduler still ticks away while Time.timeScale=0, I dont know, that source code isnt provided.
This particular issue is not actually tied to Time.timeScale, but rather CharacterLocomtion.TimeScale=0. I've narrowed down to AnimatorMonitor.cs it has a couple places where it does this
while (IsInTransition()) { ...
where IsInTransition is checking for
m_Animator.IsInTransition(i)
. It is an infinite loop when CharacterLocomotion.TimeScale is set to 0. I actually got this state change idea from another
forum thread you replied in.
Is there an intended way for pausing gameplay with UCC? I've not found any documentation on it.
As for TIme.timeScale = 0, from what I've read, Time.timeScale=0 is generally the only way "pausing" gameplay in Unity is handled.
How do you handle pausing physics objects and particles and everything else if you don't set TimeScale to 0 without managing all references to these things?