How can I smoothly transition from an animation to an idle animation?

0 favourites
  • 4 posts
From the Asset Store
4 Block Soldiers with different animations, 400x400
  • Firstly, I am pretty new to Construct 3 and gamedev in general, so sorry if this is a super easy topic. The issue I am having is that I've got a little spiny turtle guy as an enemy sprite and I want to make it so that when the player is within the enemy's LOS, the enemy play the animation that ejects the spikes. After it plays that animation, I want it to smoothly transition to the idle animation that continuously loops as long as the player is in the LOS of the enemy. Then when the player exits the line of sight, it retracts its spikes and plays the non-spiky idle animation.

    So far, I've tried setting it up so that when the player is within 100px of the enemy, it plays the spike ejection animation, waits 0.5 seconds and then plays the idle animation. Unfortunately this is not working, so any sort of help would be much appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, it's because in your event, as long as enemy has LOS of the player, it will loop the action, you need a condition to stop the loop, for example checking the animation :

    -if enemy has LOS to player

    -"spikesout" isn't playing

    -"spikeidle" isn't playing

    -> Set animation to "spikeout"

    Also instead of using "wait" action :

    -On "spikeout" finished

    -> Set animation to "spikeidle"

  • Hi, it's because in your event, as long as enemy has LOS of the player, it will loop the action, you need a condition to stop the loop, for example checking the animation :

    -if enemy has LOS to player

    -"spikesout" isn't playing

    -"spikeidle" isn't playing

    -> Set animation to "spikeout"

    Also instead of using "wait" action :

    -On "spikeout" finished

    -> Set animation to "spikeidle"

    Awesome, that worked perfectly. Thanks so much for the help!

  • No problem! Good luck with your game

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