Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kittikun on February 28, 2014, 12:50:31 AM

Title: Advanced Anchor and Tween Position
Post by: kittikun on February 28, 2014, 12:50:31 AM
Hi,

I am using a sprite with only the left anchor set and am moving its position Y with a tweenposition

When the tween is running, the sprite X also does change ? Is there a workaround for this ?

Thank you
Title: Re: Advanced Anchor and Tween Position
Post by: ArenMook on February 28, 2014, 07:48:58 PM
Tweens will adjust anchors as they move. It's intentional, as otherwise nothing would move. If you are trying to move only along a single axis (Y in your case), then you can just do it in-code instead of using a tween.
  1. widget.transform.localPosition.y = Mathf.Lerp(fromY, toY, someFactorValue);