How do I make an enemy move away from an object upon contact

0 favourites
  • 6 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Hey, I've been making a zelda clone and this is what I've got so far: h t t p s ://vine.co/v/OV3adl6DOOK

    I want to make it so that the enemy jumps in the opposite direction when it gets hit by the magic attack. I'm pretty sure this is where Custom Movements come in handy, but the manual isn't very helpful. Any clue?

  • use set vector X or Y action

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • use set vector X or Y action

    in 8 Direction? I can't, because I need the enemy to move in the opposite direction of the attack, and the attack could come in any direction. Unless I'm wrong, vector X or Y only lets you move in specific directions.

  • I'm going through the manual again. If anyone has an idea, please speak up!

  • I can't find anything in the manual that applies here. Any help?

  • in 8 Direction? I can't, because I need the enemy to move in the opposite direction of the attack, and the attack could come in any direction. Unless I'm wrong, vector X or Y only lets you move in specific directions.

    When your character hits an enemy, you need to find the angle between the enemy and the character, then move the enemy 180 degrees from that angle.

    I've never used the 8 direction behaviour, so the logic may need some tweaking based on it's properties. Sorry, I'm not at home so I can't work out a more elegant solution for you.

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