[Solved] LOS works, but sees thru solid tilemap cells

Get help using Construct 2

Post » Wed Dec 31, 2014 6:23 pm

I have LOS working mostly. The Player screams when he has LOS to a monster. However, LOS sees thru solid tilemap walls. Not sure why. Does LOS not work when Player and tilemap solid walls are on diff layers? I would think it should but so far, it doesn't appear to.
Last edited by locohost on Fri Jan 02, 2015 12:35 am, edited 1 time in total.
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Wed Dec 31, 2014 7:06 pm

Los is to a point only.
The hotspot.
Image ImageImage
B
168
S
50
G
169
Posts: 8,282
Reputation: 108,193

Post » Wed Dec 31, 2014 7:32 pm

newt wrote:Los is to a point only.
The hotspot.

Thanks for the reply, but that's not completely true. According to online C2 docs...

The Line-of-sight (LOS) behavior allows the ability to check if two objects can "see" each other. More precisely, it will check if there are any obstacles blocking a line between the two objects.

https://www.scirra.com/manual/163/line-of-sight
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Wed Dec 31, 2014 7:38 pm

Ok I figured it out. I was setting the LOS behavior properties on just one instance of the many Person sprites. I had to set the Range and Obstacles in the Person onCreate event. It works fine now :shock:
B
13
S
4
Posts: 280
Reputation: 1,578


Return to How do I....?

Who is online

Users browsing this forum: plinkie, zenox98 and 16 guests