How do I make enemies follow the player?

Get help using Construct 2

Post » Fri Sep 11, 2015 1:26 pm

hi everybody i make top down shooter game and i want to ask:
how to make that the enemies will follow the player when they close to him?
B
8
S
3
Posts: 100
Reputation: 1,023

Post » Fri Sep 11, 2015 2:18 pm

Give the enemies the line-of-sight behavior, set the obstacles to custom (unless you want the sight blocked by solid objects) and adjust the range to your needs. Set the cone of view to 360.

Now check if the enemy has LOS of the player and move it towards the players position.
B
16
S
3
Posts: 67
Reputation: 1,044

Post » Fri Sep 11, 2015 4:26 pm

WackyToaster wrote:Give the enemies the line-of-sight behavior, set the obstacles to custom (unless you want the sight blocked by solid objects) and adjust the range to your needs. Set the cone of view to 360.

Now check if the enemy has LOS of the player and move it towards the players position.


thanks :) . how i make that the enemies will follow after the player without change their angle?
B
8
S
3
Posts: 100
Reputation: 1,023

Post » Fri Sep 11, 2015 7:23 pm

add a sprite on top of the enemy, every tick set position (not angle, just position)

this way you have a pathfinding floor piece, and a image of the enemy on top
B
9
S
3
Posts: 102
Reputation: 987

Post » Wed Sep 16, 2015 12:44 pm

Aher0 wrote:add a sprite on top of the enemy, every tick set position (not angle, just position)

this way you have a pathfinding floor piece, and a image of the enemy on top


thanks. can i make that the enemy will follow after the player with bullet behaviour without change the position ?
B
8
S
3
Posts: 100
Reputation: 1,023

Post » Wed Sep 16, 2015 3:39 pm

B
56
S
15
G
13
Posts: 826
Reputation: 17,645


Return to How do I....?

Who is online

Users browsing this forum: ajcoppersmith, blue visionary and 4 guests