Can't figure out this animation issue

0 favourites
  • 7 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • In my game, when an enemy is killed, he plays his death animation and despawns. Occasionally, and not consistently replicable, the animation will start from the beginning partway through the animation.

    Here is all the code related to their deaths.

    Any idea on how to fix would be greatly appreciated!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • " the animation will start from the beginning partway through the animation. " is that a typo or just confusing phrasing? There is nothing obviously wrong with the events in the screenshot, the bug is probably caused by the other events, a conflict of trying to playing different animations at the same time, it's a common problem.

    Your event relies on 'Animation 1' to be playing but there's no indication that you stop it from forcing 'Animation 1', however we cannot see the other events. If you can't work out where the conflict is with the events then better to share the project file for someone to take a look.

  • Animation 1 is the default animation for the enemies standing there.

    Yeah, the animation restarts halfway through. I'll check around the project for conflicts.

  • Ok restarts, and if that's the only place where you play the death animation then add some logging to the events to check if maybe something is colliding more than once that you don't expect. You can add Browser object and use log to print something in console, you can narrow it down to see if collision is happening more than once however I wouldn't expect so since Animation 1 needs to be playing to trigger the death animation.

  • You potentially have something resetting your character to "Animation 1" after they are killed, then they get set back to the death animation since they are dead and on "Animation 1" again.

  • Not anything in the game caused the enemies to go back to animation 1. I believe the issue was caused by the hunter's attack, which causes them to switch to a certain frame. Anyway, fixed it by adding a 'dead' variable.

  • Not anything in the game caused the enemies to go back to animation 1. I believe the issue was caused by the hunter's attack, which causes them to switch to a certain frame. Anyway, fixed it by adding a 'dead' variable.

    Exactly, most of the time it's caused by a conflict with other animation events. Try to get them to work as independently as possible and it will minimize the bugs.

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