layers

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11943
    anglo
    Participant

    Sorry for the mess but just learning how to use this forum.
    As a suggestion.
    Can the target of ‘Can see Tartget” be defined also (and/or) as a layer instead of an specific GameObject?
    This way any object that belong to that layer would be “see”
    Thanks.

    #11948
    Gavalakis
    Keymaster

    Hey, Don’t worry about it.

    This is not possible with the current “Can See” condition and a new one will need to be created. I can create it for you if you want and post it here, but please note that since Unity does not have any internal quick method of getting all gameobjects in a layer, the only way to do it, is to get ALL gameobjects in the scene and iterate whether they are or they are not in the requested layer. Naturally, this can become very performance heavy depending on the number of gameobjects in the scene.
    In any case, if you want such a condition, let me know. 🙂
    An alternative, would be a condition which checks if any gameobject can be seen from a provided LIST of gameobjects. Would that work for you?

    Let me know.
    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.