Help with enemy triggering

0 favourites
  • 4 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.
  • Hello, I am fairly new to construct and I am currently stuck and would love for someone to help me with my problem. I am working on a platform game and I want an enemy to activate a certain way.

    I want the enemy to activate when it appears on screen.

    1st I want the enemy to play an animation.

    2nd I want to play a sound.

    3rd I want the enemy to chase the player after the .

    I have attached a picture of my code for the event.

    The problem I am having is the enemy plays the sound but doesn't trigger the animation.

    Any help is appreciated

  • First thing I would check is the animation is called "alert". Also you have charger and charger_pf - is that correct ?(event 22)

    Any chance you can post a link to the capx ?

  • Yes the animation is called alert. Charger_pf is just a box that has the platform behavior and Charger is just the sprite of the enemy with just pin behavior, pinned to Charger_pf.

    With the code as is what happens is when the enemy appears on screen the sound effect triggers and its instance variable Alert is changed to 1 but the animation is never started so the variable is never increased to 2.

    I am at work atm but I will try and upload the capx when I get home.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I figured it out. I created 2 boolean variables one for the alert animation and one for the chasing event.

    I assumed I could do this with just one int variable but I guess not.

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