Wierd bug with LoS and Platformer behaviours!

0 favourites
  • 3 posts
From the Asset Store
10 Retro songs ideal for platformers or farming games
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • That's because the Line of Sight's Cone of View is set to 360. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)