Line of Sight and pathfinding

Get help using Construct 2

Post » Mon Aug 22, 2016 9:55 pm

Image

I have this.
This worked until I did some unrelated changes to other object.
I have tried to look in to every single setting and I can't figure out why it doesn't work.

Enemies don't even turn or move towards my character.

Is there a better way to do it?

EDIT: Also whenever I remove the "line of sight" it instantly works.... trying to figure out why.

EDIT2: I got ai kind of working by making it follow a different sprite on my player. But it's behaving like a staggering drunk. Need better AI that doesn't constantly have to stop every time it moves to a destination before proceeding again.
B
7
Posts: 28
Reputation: 333

Post » Tue Aug 23, 2016 7:57 am

Until you give us a .capx that we can download to look at exactly how you've done it, we can't really help you that much. Luckily, in my game that I'm currently working on I am also using Pathfinding and Line of Sight in the same way you are; the first thing I'm going to say is that you want to have your "Move along path" action on a different event.

If you can, do it like this:
Image
You won't need the "On start of layout: Regenerate Pathfinding obstacle map" if you don't have any obtsacles.

But like I said, a .capx would really help us to help you! ;)
----------

If you need a hand with anything, just drop me a PM.
B
8
S
2
Posts: 29
Reputation: 560

Post » Tue Aug 23, 2016 7:54 pm

https://dl.dropboxusercontent.com/u/23788876/dd/wtf.capx

I tried to replicate it. Still doesn't work for me. Is my construct broken?
B
7
Posts: 28
Reputation: 333

Post » Tue Aug 23, 2016 9:53 pm

Line Of Sight can not see the origin of an obstacle when that origin is inside the collission polygones. (you made the red one solid, and solids as obstacles).
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Aug 24, 2016 2:38 pm

99Instances2Go wrote:Line Of Sight can not see the origin of an obstacle when that origin is inside the collission polygones. (you made the red one solid, and solids as obstacles).

Oh... that explains a lot. Thank you!
I just thought my character had to be solid to collide with solid...
B
7
Posts: 28
Reputation: 333

Post » Wed Aug 24, 2016 3:05 pm

Yesh it has to be solid to do that. Just use Custom obstacles ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: Congrats2u, Klarner and 29 guests