Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

 Is there any way to change the beginning and end reference values of a tween while still compensating for its current value


so for instance, say I have a EaseInOutSine patrol tween and it's going from 25 - 35, and I want to smoothly change it so that it is going from 15-40,  BUT, at the particular frame where I want it to change, the value is at 27 and on its way up. Is there some way to have it stay at '27', and progress to the other min/max values of the new tween without 'teleporting' at the moment of the swap?

I know what you are describing.  I will need to give this some thought. I might have a solution in mind, but I want to try it out before suggesting it.

Let me get back to you. :)

Great, thank you so much!

(1 edit)

So! I'm not sure if this is going to work for you or not, but I have found one possible solution. It involves firing 2 tweens at the same time and effectively switching between them by lerping to the value of the desired tween. It's a bit funky, but it might do what you need it to. Do note though, that both tweens should use the same duration for this trick to work best. Here is a link to an example project. The code is in obj_Example.  When running the example, click the left mouse button to toggle between the 2 tweens.
Let me know if this helps at all.

http://www.stephenloney.com/_/Share/LerpingTweens.yyz

Ah this is super cool but unfortunately doesn't solve my issue. As the tweens in question woud have different durations... 

I might know of a solution for differing durations. I may have something later this week to throw past you if it works out.

Yay, let me know!

I've updated the example project to better adjust for tweens with different timings.

This is not a great solution, as it isn't a streamlined solution, but it might work well enough depending on your needs :)

http://www.stephenloney.com/_/Share/LerpingTweens.yyz

Thanks so much!