How do I get the enemy to face player when attacking?

Get help using Construct 2

Post » Sun Mar 22, 2015 7:29 pm

Hi all,

Having an issue after the enemy is attacking the player. The attack animation works fine its just when the enemy attacks they are not facing the Player. How do get the enemy to face the player when attacked? I tried the mirror vs not mirrored but then that messes with the pathing left to right.

Also a side question....

I tried the various methods posted here on the tutorials for shooting left but the player still shoots right when facing left any suggestions on either of these would much appreciated.

Capx for reference
http://drive.google.com/uc?id=0B7NWymIXUoTBQTFWQjdOOFNUaUU

:Edit
Try this link http://1drv.ms/1Ced9cG
Last edited by deerta on Sun Mar 22, 2015 8:21 pm, edited 1 time in total.
B
57
S
10
Posts: 22
Reputation: 2,656

Post » Sun Mar 22, 2015 7:43 pm

The link to your capx is broken.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Sun Mar 22, 2015 8:12 pm

HI Linkman

I'm not sure how else to fix the link I did it the same way as my last post. I clicked that link and worked for me. What happens when you click it?
B
57
S
10
Posts: 22
Reputation: 2,656

Post » Thu Mar 26, 2015 6:26 pm

deerta wrote:The attack animation works fine its just when the enemy attacks they are not facing the Player. How do get the enemy to face the player when attacked? I tried the mirror vs not mirrored but then that messes with the pathing left to right.


try to compare your character X coordinate with your enemy.
if enemy.X < Char.X then set not mirrored (or maybe flip)
if enemy.X > Char.X then set mirrored

deerta wrote:the player still shoots right when facing left any suggestions on either of these would much appreciated.

when facing left, set your bullet speed to minus.
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
64
S
14
G
2
Posts: 291
Reputation: 6,666

Post » Thu Mar 26, 2015 11:57 pm

Hi Puntodamar,

Thanks!!! I got them to attack facing me with your help :)
B
57
S
10
Posts: 22
Reputation: 2,656


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, R0J0hound and 39 guests

cron