How do I make the enemy follow the player

Get help using Construct 2

Post » Sun Sep 03, 2017 1:29 pm

Hi, I am making a top-down twin stick shooter and I need to find out how to make the enemy follow my player when they see him. What behaviors and coding do i use? I already have line of sight down, though, I just need the appropriate behavior and coding.
B
3
Posts: 5
Reputation: 184

Post » Sun Sep 03, 2017 2:45 pm

Pathfinding behavior maybe?
There is a demo pathfinding example in Construct 2 when you start a new project.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
102
Posts: 1,455
Reputation: 54,979

Post » Sun Sep 03, 2017 9:09 pm

@RyukenHirimoto

You can change the Range on the Line Of Sight

https://www.dropbox.com/s/n7gc6s6b4q3b1qs/Follow%2BLineOfSight.capx?dl=0
B
45
S
26
G
88
Posts: 317
Reputation: 48,812

Post » Thu Sep 14, 2017 2:14 pm

Message: RyukenHirimoto can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
tarek2 wrote:@RyukenHirimoto

You can change the Range on the Line Of Sight

https://www.dropbox.com/s/n7gc6s6b4q3b1qs/Follow%2BLineOfSight.capx?dl=0

Yeah but i don't want them to rotate. Anything else?
B
3
Posts: 5
Reputation: 184

Post » Thu Sep 14, 2017 2:33 pm

RyukenHirimoto wrote:Yeah but i don't want them to rotate. Anything else?


For all enemies set "Set angle=no" in Bullet bahavior.
Also in the event sheet replace "Monster: Set angle to" action with "Monster: Set Bullet angle of motion to".
Monsters will follow the player and will not rotate.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
102
Posts: 1,455
Reputation: 54,979

Post » Thu Sep 14, 2017 2:49 pm

dop2000 wrote:
RyukenHirimoto wrote:Yeah but i don't want them to rotate. Anything else?


For all enemies set "Set angle=no" in Bullet bahavior.
Also in the event sheet replace "Monster: Set angle to" action with "Monster: Set Bullet angle of motion to".
Monsters will follow the player and will not rotate.


I think I got it now, thanks.
B
3
Posts: 5
Reputation: 184


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests