How do I Pick some instances as Custom LOS

0 favourites
  • 6 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • No way to pick a custom obstacle from a families, it always pick the entire family.

    The picking works if LOS is used with Solids but If change the to use Custom the picking stops working and picks all the instances

    I modified the LOS scirra example to illustrate this:

    Only the objects on the right side shouls block LOS


  • Hi,

    You cannot specify witch object to be an obstacle for LIne Of Sight behavior (as well as Pathfinding behavior), but only object type or entire family. The "add obstacle" action applies to all instances, it's construct 2 built in.

    So depending on what you want to achieve, you'll have to avoid this.

    Maybe you can tell more about your project and we can find a solution.

  • arrrgh! Thanks for clearing this This is my prototype.

    I´v already a system using an invisible sprite created on top of the tiles at runtime (that's what turns the orange cones to gray, while the LOS plug turns opacity to 100%) I will try and extend it this way.

    Each tile as different elevation and depending on the tile my astronaut stands it will block LOS if higher.

    If using colliders this will also prevent the Astronaut to move smoothly in to a solid tile (theres is a jump while the code re-cycles)

    I´m also planing to add other LOS blocking features (vegetation etc..) and on top of that have also some kind of LOfire. So using colliders for LOS is not an option.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can have two object types with same graphics and variables / behaviors. One being set as an obstacle to the line of sight, the other not. So when a tile is or become higher than the player, destroy it and create the same but of the type that blocks line of sight. You can encapsulate everything in function to make it clear.

    And maybe you'll be interested in ray casting (search in forums) for testing if player has direct line of sight to something. It can be customized (customised ?) to collide with what you want and thus have different kinds of obstacles.

  • Yep, I´v made it work already. After you explained how the custom LOS works with instance types only i come with a workaround. I ll see if its flexible enouf down the road.

  • i think instead of using LOS, you can use a cone-shaped sprite.

    then if that sprite overlapping an object, trigger a boolean.

    then, pick object with booelan == true

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