Author Topic: TweenPosition Problem  (Read 3212 times)

amirivala

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 17
    • View Profile
TweenPosition Problem
« on: August 13, 2013, 03:03:39 PM »
Hello
Sorry for bothering you.
I have a two NGUI Panel and i want to add tween between them but when i click on my button to start tween everythings works but my Panel after moving to the right, jump back to first place.
how can i solve my problem that my panel doesnt jump back to it first place
Sorry for my back english
and im new to coding
  1.         public GameObject Anchor;
  2.        
  3.         void OnClick(){
  4.                  TweenPosition.Begin(Anchor.gameObject, 0.5f, new Vector3(640,0,0));   
  5.         }
  6. }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TweenPosition Problem
« Reply #1 on: August 13, 2013, 07:56:22 PM »
I'm guessing you're trying to tween an object that has a UIAnchor on it.

As soon as the tween finishes, UIAnchor takes over and resets the position.

amirivala

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: TweenPosition Problem
« Reply #2 on: August 14, 2013, 01:01:03 AM »
So how can i make it wont reset and dont jump back to its first place?
Please Help Me

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TweenPosition Problem
« Reply #3 on: August 15, 2013, 07:43:55 AM »
Don't tween anchors.

Tween the object below the anchor instead.