jeffreylanters / unity-tweens

An extremely light weight, extendable and customisable tweening engine made for strictly typed script-based animations for user-interfaces and world-space objects optimised for all platforms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect Tween Duration

sam-ln opened this issue · comments

Describe the bug
Depending on the chosen duration for a tween, the time passes faster or slower than expected, causing the tween to finish too soon or too late.

To Reproduce
Attach any tween to a GameObject with a duration different from 1.
View the tween in the "Tweens" window.
The time within the tween will pass 5x slower if a duration of 5 seconds was chosen, totalling a run time of 25 seconds.

Additional context
The behaviour is caused by this line.

var timeStep = deltaTime / duration;

I'll create a pull request with a fix shortly.