Author Topic: Advanced Anchor and Tween Position  (Read 3047 times)

kittikun

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 5
  • Posts: 46
    • View Profile
Advanced Anchor and Tween Position
« 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Advanced Anchor and Tween Position
« Reply #1 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);