Invert Line Of Sight Condition

0 favourites
  • 13 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • The Sprite is destroyed even it has line of sight of sprite2

  • Use else instead.

  • Are you SURE it has line of sight all the time? Note that, according to this condition, if it loses the LoS for no matter for how long, it WILL be destroyed.

  • I put one sprite2 beside it from the start of the layout and another one outside range

  • Without a capx is hard to say what's wrong. But, even if it's beside it, maybe it's out of LoS. Depends on the angle you set for the LoS behavior and the orientation of the object with the behavior itself.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • its quite simple,just create 2 sprite2 one is in sight of Sprite and another doesnt

  • So. You're checking for absence of LoS. One of them is out of LoS, so the condition is true, and the sprite gets destroyed. I guess one of them being out of LoS is enough to trigger the condition.

  • Yes,but this will make invert useless here

  • Sadly yes... I'll try to find a workaround and I'll let you know if I do.

  • I'm not sure this is what you're looking for.... But check it and let me know.

    [attachment=0:hfct37ok][/attachment:hfct37ok]

    Move the red circle with the arrows. If it loses LoS (100 distance) for both blue circles it's destroyed. You can regenerate it by hitting SPACE.

  • Things are different when there are multiple objects

  • Indeed things are different.

    You need to separate things for each "Player" instances.

    Thanks to instance variable for example, and making sure to have a for each loop so that each "Player" instance is checked out.

  • yes,that should do the work. I am currently learning the condition with 2 object types. I tried more than 1 and unequal number of objects for both objects types. In this case line of sight.

    But I noticed that no matter i invert the condition or not, the same objects are picked. Logically thinking, they should not pick the same object. Invert conditions should pick different objects from non-inverted condition.

    Maybe i need to know more about how the second object is picked.(In the case the objects being sighted)

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