How do i stop animation from looping....

0 favourites
  • 8 posts
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • ... even though the animation loop is set to "no" on the animation window.

    Hi all

    Basically, Im using an invisible circle as a collision detection in which when activated, a snake will rise up to block your path. The detection works but the animation loops which means you can just get past the snake. This is even though the loop is set to "no" in the animation window as stated above.

    Any suggestions?

    Many thanks,

    moymoymoy

  • 1. Can you throw in a small capx? That will help us debug for you.

    2. It could be because your collision code is running again and again, which will make the animation loop.

    3. Or you have your start animation action in a place where it is called again and again.

  • https://www.dropbox.com/s/qenjzyemrjfjojg/code.png

    Here is the only part in the whole event sheet where the snake is called.

    Appreciate the help

  • It's being called every frame(tick), add another event to your conditions, "Trigger once"

  • Ahh that makes sense. Which event are you suggesting i add that too? Or do you mean a whole new event?

  • In every event that the condition is being called on every tick (like the "is overlapping" that you have).

    Also, in your photo the first event (37, or 87, I don't really make it out the image is cropped) you have a very strange condition, basically you are checking if the Player is overlapping and not overlapping Snake_Block at the same time!

    My guess is that since Construct reads events from top to bottom, the first part (is overlapping) is being replaced immediately from the second part (is not overlapping).

  • eli0s

    The first event there has 2 conditions - 1 to check if the player is in a circle which makes the snake aware of the player, 2 to check if the player is NOT the circle that makes the snake block the player. So it is two collision circles, a smaller one inside a larger one. Depending on if the player is overlapping 0, 1, or 2 of the circles will then run 1 of 3 animations.

    I managed to get it working though, thanks very much all

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • moymoymoy

    You are right, I saw the icons and I only read partially the names so I wrongly concluded that these are the same sprites and that the conditions cancel each-other...

    Anyway, I am glad you made it work

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