Author Topic: change tween easing method in code  (Read 491 times)

wprevett

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
change tween easing method in code
« on: July 27, 2017, 04:06:01 PM »
Hello,

I have some tweens that i play forward and back, and I want both of these to ease out.  Playing reverse makes it an ease in effect, and changing the easing method in code doesn't actually work it seems.

Anyone know how I can get the easing method to change in code without recreating the tween?

Thanks

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: change tween easing method in code
« Reply #1 on: July 30, 2017, 10:57:17 AM »
Are you sure you want to change the easing method? If you really do, use the AnimationCurve property

myTween.animationCurve = AnimationCurve.EaseInOut(0f,0f,1f,1f);

That's an ease-in Curve, and (1,1,0,0) is a typical ease-out

wprevett

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: change tween easing method in code
« Reply #2 on: July 31, 2017, 12:45:15 PM »
That got me where I needed to be, thanks!