Unexpected result when resetting a tween

I think it is a common procedure when using tweens to want to reset the tween at some point. If you want to delete a tween before it’s finished and create another with that same name again then it will erroneously return true to the condition “if tween has finished playing”. Examples:

first picture we are resetting the tween so it returns true in the condition “if tween has finished playing”

second picture we are creating a different tween so it returns false in the condition “if tween has finished playing”


You can always add some scene variable to add an extra check for instance:
Begin of scene set a variable my_tween_started = 0
Then in the check condition when
Condition:

  • Space is pressed
  • Trigger Once
  • my_tween_started = 0

Action:

  • my_tween_started =1

Then in the other condition:
Condition:

  • Tween “right” finished…
  • my_tween_started =1

Action:

  • my_tween_started = 0

This way you ensure that this is only trigger once even if the Space is pressed more than one time when your my_tween_started is 0 or 1 depending on your needs.