Author Topic: Weird tweens  (Read 3085 times)

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Weird tweens
« on: June 25, 2012, 11:18:44 AM »
Hi!

I have a sidebar menu which has buttons arranged with a UIGrid. I have these buttons fade in by firing their TweenPosition scripts, but when I want to do it backwards, a few of them just instantly "teleport" back to the original position, not respecting the duration.

Did I mess something up or is it just a weird problem?

PhilipC

  • Guest
Re: Weird tweens
« Reply #1 on: June 25, 2012, 11:48:39 AM »
I'm not sure what you could have done but it does sound like something you did messed it up as I just tried it and it seems to work fine. Double check you tween duration?

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: Weird tweens
« Reply #2 on: June 25, 2012, 12:08:40 PM »
Debug.Log prints right values.
In editor mode if I modify the duration to 10 and fire it manually, i get the same result :(

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: Weird tweens
« Reply #3 on: June 25, 2012, 12:49:41 PM »
Additional info: The grid is inside a Soft-clipped panel.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Weird tweens
« Reply #4 on: June 25, 2012, 12:58:34 PM »
First question that I always ask in similar situations: Is the UIPanel's 'Static' property checked?

There is no reason why "a few" would not respect the tween while the rest would. I'd look at them closer if I was you.

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: Weird tweens
« Reply #5 on: June 25, 2012, 01:01:48 PM »
The checkbox is not checked

rain

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 79
    • View Profile
Re: Weird tweens
« Reply #6 on: June 25, 2012, 01:29:17 PM »
Also, i'm changing the duration of the tween after starting it forward, making the reverse tweening time different.

By the way I solved the problem by destroying the current tweenpositions, adding new tweenposition components and reassigning their values via code, but replacing the destination and starting location, then playing them in forward direction.