Wierd bug with LoS and Platformer behaviours!

Get help using Construct 2

Post » Sun Sep 04, 2016 12:20 pm

Hello everyone!

I am writting a platformer game.

I have EnemyInstance and PlayerInstance. Enemy should begin to chase player when he sees him (LoS used).

I have set the following options


The wierd thing is that chasing becomes "1" only when i press UP in LoS distance of Enemy. If I didn't, the enemy cannot see me and stands still.

I was using Solids, and also used Custom obstacles - an in the image. It worked correctly only when I put "Custom" and set no custom borders for LoS. But this leads to Enemies can see through walls. ))

How can I fix it?

Thank you!
Posts: 7
Reputation: 189

Post » Sun Sep 04, 2016 3:45 pm

Are you certain that chasing becomes 1 only when you press up? Check in debug mode what the variable is doing, maybe it's 1 the whole time and the enemy can see the player but doesn't move for some other reason. I just set up an identical level and it's working fine for me although I don't know the intricacies of the custom obstacles in your level.
Posts: 2,166
Reputation: 46,349

Post » Sun Sep 04, 2016 5:07 pm

That's because the Line of Sight's Cone of View is set to 360. :mrgreen:

I've made an example with a Cone of View of 180.

https://www.dropbox.com/s/ck98498wwpbqw ... .capx?dl=0

Please try the following

1. Jump up to the top of the obstacle and be seen by the enemy with a Cone of View of 180.
2. Enemy doesn't follow the Player.
3. Hit the button to change the Cone of View to 360.
4. Enemy follows the Player.
Posts: 256
Reputation: 9,207

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], hrisnz and 15 guests