Author Topic: Tweens not replaying correctly  (Read 5184 times)

Moradom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 15
    • View Profile
Tweens not replaying correctly
« on: December 26, 2013, 04:13:50 PM »
Hello all,

I have some simple Tween position scripts on my panels to move them on and off the screen. When the appropriate button is pressed it will trigger these tweens.

Each of these tweens has an animation curve and a duration. The duration will work the first time the animation is played, but anytime after that it will just "warp" to the position, ignoring the duration and/or animation curve (This is setup all in the Unity inspector)

I did see a few posts on this issue, and it was said to be addressed in a earlier version of NGUI. I am using the latest version and it does not appear to be fixed.

Anyone see this problem? This seems straightforward, am I missing something?

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tweens not replaying correctly
« Reply #1 on: December 26, 2013, 06:50:32 PM »
What triggers your tweens? And when you say the latest, which version do you actually have?

Moradom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 15
    • View Profile
Re: Tweens not replaying correctly
« Reply #2 on: December 26, 2013, 09:33:42 PM »
Hi Aren

I am using version 3.0.7f3. I am using UIPlayTween to call the tween animations on the objects

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tweens not replaying correctly
« Reply #3 on: December 27, 2013, 04:01:27 PM »
UIPlayTween has various settings regarding what happens, such as what happens if the tween is already at the end. How are yours set up?

Moradom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 15
    • View Profile
Re: Tweens not replaying correctly
« Reply #4 on: December 27, 2013, 05:15:23 PM »
Here is my setup

tigger condition - On Click
Play Direction - Forward
If Target is  disabled - Do Nothing
if Already Playing - Continue
When Finished - Do not disable


If I call the tween's play forward and play reverse functions from code, it will always work. It seems like this problem only exists if I use UIPlayTween

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tweens not replaying correctly
« Reply #5 on: December 28, 2013, 02:06:20 AM »
UIPlayTween simply calls tween.Play(true), which is also what PlayForward() does. You can check the code in UIPlayTween, around line 292.