Search Unity

Question How to easily make all children that are walkable non-walkable

Discussion in 'Navigation' started by JackaloMoss, Apr 17, 2023.

  1. JackaloMoss

    JackaloMoss

    Joined:
    Apr 15, 2023
    Posts:
    1
    Hi,

    Take the simple example of a prefab of the form:

    EmptyObject
    1x1 Plane
    0.1x0.1 Plane
    0.1x0.1 Plane​

    Where the 0.1x0.1 planes are arranged ontop of the 1x1 plane to make a plus shape.

    The NavMeshAgent should only walk ontop of the plus shape. This is easily achievable by only making the 0.1x0.1 plane's walkable. However if you have one of these prefabs and you want to make both the 0.1x0.1 plane's nonwalkable, you have to select each one and make them both nonwalkable manually. A workaround can be done by giving the emptyObject a mesh renderer and then making it walkable/nonwalkable and choosing to apply this to children, however this then applies it to all the children, where I only want to apply it to the 0.1x0.1 plane children not the 1x1 plane children.
     

    Attached Files: