[SOLVED] "When tween has finished playing" doesn't take pauses into account

Hi.
I have a door that can be opened with a button. The door automatically closes soon after. If the player is in the way (close to the door), the tween which closes the door pauses until the player moves farther away again (so the player won’t get squished).

I want certain actions to be performed when the door has completely closed. The problem I’m facing is that the “Tween has finished playing” -condition doesn’t seem to take pauses into account. I’ve set my “move down” -tween (which closes the door) to finish in 1 second. Obviously the door isn’t done descending in 1 second if it needs to pause at some point, but the engine doesn’t seem to take this into account.

Is this intended behavior?
Can you suggest workarounds?

Thank you

Does this only happen when there is more than one Mech_Door that opens and closes? And it only works if there is one Mech_Door opening and closing?

If that’s the case, then it’s your last events causing the issue, not GDevelop’s tweens.

1 Like

In addition to MrMen’s questions above, keep in mind that with this event:

You’re making the tween resume every single frame that the door is over 99 pixels away from the player. You should probably add a trigger once to the conditions here.

1 Like

I’m still figuring out some details, but I think I’ll get it to work.

You were 100% correct. Great thinking. I didn’t realize I had placed another mech door at the other end of my room.

I started using “for each instance of object” -events and this is making sense now.

Thank you

1 Like