Very annoying LOS issue :(

0 favourites
  • 4 posts
  • Hello community! Since the last week I have worked trying to solve myself an issue with the LOS that I simply can't understand, so here I am, I need the community help!

    Basically I've drawn an enemy with platform and LOS behaviours. When the Player is in LOS the enemy starts to move and throws stones at the player. Up to here works perfectly.

    Now, as the layout is vertically developed, I want to avoid tha the enemies on the upper levels can see the player, and same thing for the enemies on the lower levels.

    In order to try to afford this, I have simply granted the SOLID behaviour to COLLIDER object (set on every floor, on every level). COLLIDER has already got the "jump through" but I didn't know if it was "seen" as SOLID or not so I added solid too.

    Well, now the enemies can't see me even if I am in front of them.

    They have 360 degrees and 800 pixel LOS.

    At this point I tried to bypass the issue by setting "custom" on enemy obstacle voice, deleting the solid behaviour on COLLIDER and, at the end, adding the event "every tic - enemy LOS add Obstacle COLLIDER".

    By doing this the enemies can now see me through the colliders, up and down, even if I put a collider in front of them.

    Is it because the colliders are, obiously, set as "invisible".

    Is there a way to solve this? I just want that the enemies can see horizontally in front and behind them, and not up and down.

    Thank you for you help guys, and sorry for my bad english (I hope it is enough clear).

  • Not sure why that is happening as obstacle should act as kind of a high wall and not block all other LOS but maybe with the file it could be worked out. Maybe it's something to do with the picking of multiple enemies which is usually a problem.

    You could make use of the cone of view so if you set it to 45 degrees it is kind of a small cone and in front of them. Another way is to say that if the player Y is greater than enemy Y then they never get LOS. You only need to add the obstacle once to set it, not every tick. Obstacle set as invisible doesn't make a difference, it will still work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh well, thank you mate, I Will try and make you know if everything goes right.

    Thank you again

  • Ok, I have found a solution that's works.

    Basically if the enemy STANDS ON the collider set as obstacle, he doesen't see anything (don't know why).

    Instead, I have clonated the collider, given it another name and color and used it as "platform" for the enemies, then I put the obstacle collider on the "roof" and re-used the new colored collider upper than the obstacle.

    In this way everything works.

    I post a screenshot with the wish it could help someone else.

    In the image the BLUE collider is the OBSTACLE, meanwhile the red one is a normal collider used just as platform.

    Thank you very much again.

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