Author Topic: How do I totally reset a tween when it is in PingPong style?  (Read 1968 times)

Sahkan

  • Jr. Member
  • **
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 74
    • View Profile
How do I totally reset a tween when it is in PingPong style?
« on: January 17, 2016, 08:31:58 AM »
I'm using this code to restart a tween every time I play it, It works great for Style.Once.

  1.         tweenPosition_.from = transform.localPosition;
  2.         tweenPosition_.ResetToBeginning();
  3.         tweenPosition_.to = destination;
  4.         tweenPosition_.PlayForward();

But when I use Style.PingPong, It will will reset the animation but from the last starting point.
It means that if it started the "pong" animation, It will restart it from that "pong" and not from the "ping" state ( from the end instead of the beginning ).
How can I totally reset it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How do I totally reset a tween when it is in PingPong style?
« Reply #1 on: January 20, 2016, 08:23:39 AM »
Change the tweenFactor to 0.