Author Topic: properly reversing tweens/sequence of events  (Read 4371 times)

Drexster

  • Guest
properly reversing tweens/sequence of events
« on: May 04, 2012, 09:58:40 PM »
I have a series of objects that are animated in sequence to a completed screen state.
I'm using the Tween Position and a custom UIButton Tween script, with the only difference from the original being that it sends the play message once itself has gotten a "Complete" message from it's own object's tween script, indicating it's completed it's own tween.

This allows me to sequence object tweens one after another, very nicely.

However I'm having issues reversing the sequence of events when i need to get rid of the screen in question. I've tried duplicating the setup in reverse on the objects using a unique tween group. But whenever the objects become active, all the Tween scripts play regardless of what group they are set to, and this causes a big mess...

Is there a way to not have certain tweens play on awake? Or can anyone think of a better way of achieving what I'm after?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: properly reversing tweens/sequence of events
« Reply #1 on: May 04, 2012, 10:02:26 PM »
I suggest you create an animation instead of using tweens. You can have an animation affect more than one object, and it's perfectly reversible.

Drexster

  • Guest
Re: properly reversing tweens/sequence of events
« Reply #2 on: May 09, 2012, 07:40:48 PM »
Wow. Cool. I didn't realise you could animate children from a parent object using unity's animation editor. Seems I've been avoiding pretty powerful feature... Thanks for pointing me in this direction.

Another thing I haven't been able to debug is that sometimes the Disable after forward/reverse doesn't disable the object in question. I say "sometimes" in the sense that it usually works but for some objects (nothing unique or special about them) it just never disables the object after playback.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: properly reversing tweens/sequence of events
« Reply #3 on: May 09, 2012, 08:01:59 PM »
It will always disable the object, provided the condition is met. Ie: it won't disable it if you set "disable after reverse" and actually played the animation forward instead.

Drexster

  • Guest
Re: properly reversing tweens/sequence of events
« Reply #4 on: May 11, 2012, 05:29:19 PM »
yeah I've noticed that, and it makes sense that way. However I have some objects that refuse to disable after their tween has played out, regardless of forward or reverse..

I'm converting my menu system to use animations instead of tweens now. I'll post again if i see this behaviour persist with using animations.