Line of sight issue

This forum is currently in read-only mode.
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hey chaps

    I am having some trouble with the line of sight behaviour. I have an enemy character 'sight' the player, It works fine in most cases, unless the player is standing under something like this.

    <img src="http://dl.dropbox.com/u/1487524/Scirra/LineOfSightFailing.png">

    The height of the enemy, player and collisions is 32px. Does anyone know technical details of the line of sight behaviour? Does it 'detect' from hotspots, image points, center mass or 0,0? I am thinking the reason it is failing is that it is detecting from 0,0 on the enemy, and thus hitting the bottom edge of the platform above.

  • dont know if you tried that already but you can just use "get distance" based events instead of LoS behaviour.

    as for the LoS not working - i dont know whats wrong.

    just my 2 newbie cents

  • The height of the enemy, player and collisions is 32px. Does anyone know technical details of the line of sight behaviour?

    I do know it's a bit quirky from when I attempted to use it for a roguelike top-down dungeon view. It would detect one side of a corridor that the character was in, but not the other. Quite vexing. I even tried centering the hotspots perfectly by making 31px objects instead of 32. Gave up on it eventually. That said, I think it should work fine for this.

    What did you mean by 'collisions is 32px'?

    Anyway, the one big variable that I noticed was the accuracy attribute of LOS. If the LineOfSight accuracy is set to 10 or below, it should work fine. I did a test of a similar setup, and it performed poorly with larger accuracy numbers, though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Irbis - I am using both distance and line of sight for this one chap

    Silent Cacophony - I refer to my ground/solid/terrain/platform bits as collisions, I read over that a few times hoping to be clear and am so used to my blanket term didn't think about explaining better.

    I am currently using 10px as the accuracy, but even at 1px it still misses that particular situation. Am thinking of a way around having to use Line of sight.

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