Getting an Enemy to face player upon spawn

  • I'm having an issue where my enemy sprite is not facing the player upon spawn. It chases the player at an angle, which makes it look weird. Does anyone know how to fix this?

    EnemyFacingIssue.capx

    This project is based on the Asteroid Clone in 100 Events or Less tutorial.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Edit the enemy animation, click the button to rotate 90 degrees clockwise.

    If you look when you place a sprite, it "faces" the direction of the line in going from the origin point to a small white square, which happens to be to the right.

  • I added an event to rotate the enemy 90 degrees clockwise as soon as it spawns, but that doesn't seem to fix the issue.

    I've tried rotating it to player.X and player.Y upon spawn (and then having it slowly keep rotating towards the player's position every tick), but it's still chasing the player sideways.

  • The ghost rain tutorial has exactly what you need

  • I did a search for Ghost Rain tutorial and didn't find it on the forums or the tutorials section of the site.

  • Again...right click on the sprite and go into the animation editor. Rotate the sprite art ITSELF 90 degrees clockwise.

    C2 considers the right side of the sprite as the front. You have your Enemy ship's front facing upwards in the sprite.

  • Ah, it works now. I guess the reason why it didn't work when I first tried your advice is because I didn't clear local memory or something. I kept getting the same problem. Thanks!

  • ghost rain is actually the ghost shooter. the beginners tutorial. Spend some time going through the tutorials and annual will solve a lot of these types of questions much faster.

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