Ploblem with animation upon collision/overlap with object

0 favourites
  • 3 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Perfect! Works like a charm. Thank you very much!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)