Finding a path when enemy has line of sight

Get help using Construct 2

Post » Thu Aug 01, 2013 12:23 am

I'm totally new to Construct 2. I'm trying to make a sprite (bad_dude) find a path to another sprite (dude) when bad_dude has line of sight to dude.

As my event I have:

"bad_dude" has line of sight to "dude"

and my action is:

"bad_dude" find path to (dude.X, dude.Y)

When I move in front of the bad_dude, he doesn't move towards me. I added a sound event to the line of sight action and the sound plays.

Why doesn't the bad dude move?
B
3
Posts: 3
Reputation: 181

Post » Thu Aug 01, 2013 1:29 am

Have you got another event:
bad_dude: on path found -> bad_dude: move along path

And make sure you're not checking for paths every tick when in line of sight. You could add a "system:every x seconds" condition.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Thu Aug 01, 2013 11:40 am

Thanks for the reply. I do have the event bad_dude: on path found -> bad_dude: move along path


I tried making the line of sight check every 0.5 seconds and that didn't work either.marmite222013-08-01 11:41:26
B
3
Posts: 3
Reputation: 181

Post » Thu Aug 01, 2013 12:00 pm

Hmm make sure there is actually a path from bad_dude to dude and that neither of them have solid behavior if you're using solids as obstacles.ramones2013-08-01 12:02:46
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Thu Aug 01, 2013 12:13 pm

I'm stuck at work now but the solid behaviour could well be the issue! I'll check later. Thanks!
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests