Hello Guest

Author Topic: UpdateAnimation deltaTime question  (Read 3341 times)

korn3l

  • Newbie
  • *
  • Posts: 12
    • View Profile
UpdateAnimation deltaTime question
« on: October 03, 2013, 12:17:07 pm »
I have the timeScale set to 0 and I want the animation to keep playing, so I'm calling the updateAnimation manually in my game object's update :

Code: [Select]
if (Time.timeScale < 0.5f && state == UnitState.Celebrating)
        {
            spriteAnimator.enabled = false;
            spriteAnimator.UpdateAnimation(1.0f / 60.0f);
        }

The animation works, but it's faster than it should be. The animation has 30 frames, frameRate 30 and clipTime 1.
It get's better when I set the delta to something like 1/100.

What value should the delta time have to play the animation at the default speed ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UpdateAnimation deltaTime question
« Reply #1 on: October 03, 2013, 05:53:22 pm »
If you want something to play through timescale = 0, you could probably replace the animator with the tk2dUISpriteAnimator instead. That works correctly even when paused.