Ploblem with animation upon collision/overlap with object

Get help using Construct 2

Post » Mon Jul 07, 2014 3:39 am

Hello, this may be a rookie mistake, but I'm having trouble with it nonetheless.

So I have a sign, and when the player collides/overlaps with said sign I want a special indicator I've made to play an animation (indicating that you can interact with the sign by pressing a button.)

The indicator is an eye, and I want it to open when near the sign, and close when away from it.

The problem is that when I create a condition that makes it so that the eye-opening animation plays when the player is overlapping the sign, the animation repeats as long as I'm touching the sign, but I only want it to play once.

To fix this, naturally I changed the overlapping condition to a collision condition. so that it would only trigger the animation once upon collision rather than every tick while I'm overlapped. This solved half of the issue, but I still need the eye to close once I'm away from the sign.

This is the problem I can't figure out. There's no way to invert the collision condition, and when I invert the overlapping condition I run into the repeating animation problem.

Is there any way to get it to detect that the player is away from the sign and promptly play the eye-closing animation ONCE? I would greatly appreciate an answer.

Thanks for reading!
B
3
Posts: 3
Reputation: 181

Post » Mon Jul 07, 2014 3:43 am

Go back to using on overlap and add the system condition "trigger once while true"

Then create another identical condition only invert it and change the animation eye to closed.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,293

Post » Mon Jul 07, 2014 4:35 am

Perfect! Works like a charm. Thank you very much!
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests