Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.29k stars 344 forks source link

Initial value calculated incorrectly in case delay is set #644

Open wrymn opened 11 months ago

wrymn commented 11 months ago

image

As in the image, the first animation has delay of 0.5s. The scale should already be 1 when that animation starts, so it should tween from 1 to 1.03 scale. However, it tweens from 0 to 1.03, because that is the starting scale of the second tween.

So either this is a bug, or very annoying intended behavior.

So expected behavior: The second animation tween scale from 0 to 1. After 0.5 second delay, the second tween starts looping the tween between 1 and 1.03 scale

However When I preview these animations in Edit mode, so via Play All on GameObject button, it works as expected :)

Demigiant commented 11 months ago

Ahoy! It's because TO tweens store their starting value only when they start (by design, because it's what one usually wants) while FROM ones set their value immediately and so they are clashing. But I see the problem, tomorrow I'm going to add a TO/FROM option so you can force both a starting and ending value on the same tween :)

Demigiant commented 11 months ago

I'm working on it but it's a much bigger change than I initially anticipated, both because I have to change the whole way the FROM/TO system works in DOTweenAnimations and because I need to guarantee that DOTweenAnimations created with the current system are converted correctly to the new one. So it's going to take me a few days to implement and then test test test it. Should be done within the week tho, and if you want a preview as soon as it's ready (and tested but not super tested) write me here.

wrymn commented 11 months ago

I'm working on it but it's a much bigger change than I initially anticipated, both because I have to change the whole way the FROM/TO system works in DOTweenAnimations and because I need to guarantee that DOTweenAnimations created with the current system are converted correctly to the new one. So it's going to take me a few days to implement and then test test test it. Should be done within the week tho, and if you want a preview as soon as it's ready (and tested but not super tested) write me here.

Thank you for looking into this 🙂

For now, I have fixed it by setting up some special curve, so this issue is not critical as of now.

By the way, if you are interested, the game where this will be used is Darfall https://store.steampowered.com/app/1961600/Darfall/ We are using more and more dotween in UI animations and it's amazing.

Demigiant commented 11 months ago

Ohhh, that looks greeeeat!!!