1
\$\begingroup\$

When the character dies, an animation plays, and then the scene resets. What I want is that nothing moves/animates except the character and the life bar so I use Time.deltaTime = 0; to do this but it also stops my character and the life bar. Is there a way to force a specific animator to use real delta time?

\$\endgroup\$
2
  • 3
    \$\begingroup\$ Presumably you looked at AnimatorUpdateMode.UnscaledTime? Did you encounter any difficulty using this to solve your problem? \$\endgroup\$ Commented Feb 23, 2022 at 15:44
  • \$\begingroup\$ If that solves your problem, be sure to write up your solution as an answer so it can help the next user searching for a way to do this. \$\endgroup\$ Commented Feb 23, 2022 at 16:00

1 Answer 1

4
\$\begingroup\$

So for those who have the same question, I've found what needs to be modified: On the animator Component, there is a drop-down menu named "Update Mode" which has three options:

  • Normal (in-sync with Update method)
  • Animate Physics (in-sync with FixedUpdate method)
  • Unscaled Time (in-sync with Update method, but uses unscaled time)

Use the third one if you have the same problem as me. Also here's a picture from unity's documentation about the animator component:

Animator Component

EDIT: I don't know why is this happening but in my case I set Time.timeScale to 0.01f instead of 0 and then everything worked as I excepted

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.