Getting an Enemy to face player upon spawn

Get help using Construct 2

Post » Mon Mar 11, 2013 5:13 am

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.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Mon Mar 11, 2013 5:19 am

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.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Mon Mar 11, 2013 5:22 am

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.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Mon Mar 11, 2013 5:23 am

The ghost rain tutorial has exactly what you need
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Mon Mar 11, 2013 5:24 am

I did a search for Ghost Rain tutorial and didn't find it on the forums or the tutorials section of the site.Excal2013-03-11 05:24:49
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Mon Mar 11, 2013 5:34 am

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.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Mon Mar 11, 2013 5:37 am

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!Excal2013-03-11 05:38:05
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Mon Mar 11, 2013 6:34 am

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.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, dieblume86, Kagubro, Yahoo [Bot] and 2 guests