How do I get this animation to trigger correctly? [SOLVED]

0 favourites
  • 9 posts
From the Asset Store
Game Triggers is as versatile as a Swiss army knife, and will be a great resource for any type of game you're creating.
  • Enemy is supposed to charge up (PreDashFace... state) and then dash. When they collide with the edge marker, they should turn around and enter the PreDash state again. When facing right, the PreDash animation will not trigger. That is the only thing not working.

    Gif of error

    Code of error

    Feel free to crit my code; I'm pretty new at this

  • i have same big issue my anim states never can triger right.. so i think only way is to add variable numbers to pick which frame state to do and wait for one state to finish and change var trigger number and then when that number is a value another trigger.. finally changing to a finish state value which goes back to default ... ughhhhrrr I hope someone make example capx....

  • It's difficult to say without seeing a capx. However, I would start by adding a trigger once to lines 27 and 30 - you don't want those events firing every tick, they just need to happen once when the state changes.

  • Colludium Ah thanks!

    And here is the .capx

  • Cool - yeah, trigger once is often your friend for things like this!

  • thx good work!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Colludium Quick question: how did you know to use it with events 27 and 30 and not the others? I understand what Trigger Once does but I guess I'm confused as to when is appropriate to use it.

  • Of course. Remember that each event will run each tick if the condition is true; the exceptions being triggers and conditions with trigger once under them. The set animations with a wait of 2 seconds doesn't make logical sense if it runs every tick - 60 times per second a 2 second timer is started. I can't be sure how that caused the error because c2 reverts conditions when a wait is up and the wait was for longer than the travel time of the sprite, so all sorts of weird things could happen. Tldr - a wait running every tick will not work.

  • Colludium Got it! Makes total sense now. Appreciate the help!

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