Don't set _secondsSinceStart in set_startDelay. #2262
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the issue where setting the startDelay after creation of the tween doesn't work.
When you set a delay of 3 for the first time before the tween started, _secondsSinceStart becomes 0 * 0 + 3.
So the tween now acts as if 3 seconds have passed since the start. Meaning that it skips the delay of 3 seconds. Furthermore I don't see a good reason as to why you would want to increase the delay after the tween has already started (Started as in had its first update. Essentially every tween has already started, since .start() gets called on creation). And if there was a good reason to do so, I don't see why changing the delay from 3 to 5 seconds should have the _secondsSinceStart be increased by 2 seconds. This might make sense for the loopDelay, but not for the startDelay.