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
157
Posts: 2,212
Reputation: 83,505

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
54
S
33
G
95
Posts: 435
Reputation: 53,546

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
157
Posts: 2,212
Reputation: 83,505

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: Zed2100 and 9 guests