How do I make the enemy follow me?

Get help using Construct 2

Post » Sat Aug 02, 2014 5:30 pm

Hey guys, i'm having a problem with the enemy following the player, i added line of sight, when he sees me he follows me to death, but, with and obstacle in his way, he just stop there waiting for me to appear again, what i want to do is, in the first time the enemy sees me, it will pursue me forever, evene if i hide behind an obstacle, i tried using pathfindin but then i can't make him move from its place, i really dont know what to do, please help, its really important :D

( sry my english, im from Brazil )
B
4
Posts: 11
Reputation: 212

Post » Sat Aug 02, 2014 5:54 pm

When you say "obstacle in the way" do you mean you want the enemy to jump over the obstacle or move through the obstacle?
B
12
S
3
G
1
Posts: 35
Reputation: 838

Post » Sat Aug 02, 2014 6:54 pm

Weleavefossils wrote:When you say "obstacle in the way" do you mean you want the enemy to jump over the obstacle or move through the obstacle?



move through :)
B
4
Posts: 11
Reputation: 212

Post » Sun Aug 03, 2014 2:23 am

Can you post a capx?
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sun Aug 03, 2014 3:21 am

How about when player is within line of sight, disable collision? Not sure if you would want to turn collision back on once it reached the player though.
B
12
S
3
G
1
Posts: 35
Reputation: 838

Post » Sun Aug 03, 2014 3:30 am

KevinTealeaf wrote:i tried using pathfindin but then i can't make him move from its place


Please explain
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Aug 03, 2014 1:32 pm

@TheDom - there's the .capx

@Weleavefossils - i tried that but then the enemy go like a ghost trough the walls and, unless its the ghost enemy, i dont wan that :(

@codah - i used pathfinding but i really don't know how to use it, so, the player continues with the same effect that,when the enemy sees the player, it follows him, but, when the player hides behind anything with collision, the enemy just stops in its lats position, what i want is that the enemy continues following the player finding his path trough the walls, see the .capx and you will understand better ;)
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 11
Reputation: 212

Post » Tue Aug 05, 2014 1:52 am

sry to bump but i rly need some help :/
B
4
Posts: 11
Reputation: 212

Post » Tue Aug 05, 2014 2:38 am

you have it set
if enemy has line of site
then chase player

which means, when enemy loses line of site, that's no longer true.

you need to set a state. try making a variable

if enemy has line of site
then set variable to 1

if variable is 1, chase player.

this way, when the enemy loses line of sight, the variable can still be 1 and he will keep chasing.
Last edited by spacedoubt on Tue Aug 05, 2014 2:38 am, edited 1 time in total.
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Tue Aug 05, 2014 2:38 am

It doesn't show anything about how you've tried to use pathfinding.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests