Line of Sight and families

This forum is currently in read-only mode.
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • I'm trying to use the line of sight behavior without much luck. I have a bunch of instances of the same object (Enemy1), and they're all in a family (Targets). I'm doing a test whether the player is in the line of sight of a selected enemy. The enemy is picked through its family, and I can tell the picking works because other stuff happens to the enemy that doesn't include line of sight and that all works on the specific instance of Enemy I select. However, testing for line of sight seems to have no effect (the player is always in the line of sight regardless of the angle settings or distance settings, even angle 0). If I use the instance itself instead of the family it works but that won't work in the future where there will be enemies of different instances (e.g. Enemy2, Enemy3) etc, each in the family Targets.

    I read about some bugs with line of sight but it seemed like using families would make stuff work, but apparently not. I'm wondering if there's a known workaround or if I'm possibly doing something wrong.

    I could upload a cap if needed but I'd rather not do that to you guys because the cap is pretty complicated at this point and would probably be a pain to work through if the error is in some part of the cap that is not directly where the LOS check happens, and even that part is annoyingly complicated using arrays and indexing in an extremely convoluted way :P

  • There is problem with LOS and Families or if using more than one instance of an object. The behavior always picks just the first one. I've seen a workaround, using custom LOS. I'll try to find it.

    here's one

    another

    I've tried this and it works:

    + System: For each Enemy

    + Player: Has LOS to Enemy -> do something

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply and information. Looks like there will be a solution in there somewhere that's ideal for me (I'm liking the cone of view code and can use it for a few other things in addition to LOS :) )

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