[SOLVED]How do I detect on which side enemy from player is?

Get help using Construct 2

Post » Tue Aug 11, 2015 6:45 pm

I try to make a platformer where enemy always goes in the direction of a player, but I can't find a way for detecting on which side of player enemy is.
Last edited by Human on Tue Aug 11, 2015 6:59 pm, edited 1 time in total.
B
11
S
4
Posts: 53
Reputation: 1,148

Post » Tue Aug 11, 2015 6:48 pm

I would add LOS and platform behaviour (with controls disabled) to the enemy. Then if player is in line of sight, then move enemy towards direction of player.
Image
B
14
S
4
Posts: 145
Reputation: 1,948

Post » Tue Aug 11, 2015 6:51 pm

No, the enemy has to always know on which side player is, no matter if he sees him.
B
11
S
4
Posts: 53
Reputation: 1,148

Post » Tue Aug 11, 2015 6:55 pm

If the enemies X position is > the players X position, he's on the right. If it's less, he's on the left.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Tue Aug 11, 2015 6:59 pm

Thank you, so simple and yet I could not find it (actually I used it once myself, but forgot about it, silly me)
B
11
S
4
Posts: 53
Reputation: 1,148


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 10 guests