Search Unity

[SOLVED] [C#] Can i select a child GO, from a parent GO - (AI waypoint system) - SOLVED!

Discussion in 'Scripting' started by Vaupell, Nov 29, 2015.

  1. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    Working on some AI for some vehicles.
    And want to make use of the same code for multiple different vehicles and levels.
    Only thing changing is the way point package, (group)


    Some of these vehicles have particular patrol routes, so i've made several waypoints(empty GO).
    These waypoints i all put into a empty GO see img WayPoint.PNG
    WayPoint.PNG

    So in order for my AI to use those i just have a public GameObject WayPoint Group.
    Code (csharp):
    1.  
    2. public GameObject waypointGroup;
    3.  
    WayPoinInspector.PNG

    Now for me to continue on this, i would like to take these GO's in the package.
    and maybe change them into an Array OR is it possible to select them as is similar to an array?


    I'm thinking, i may add an option to the AI_inspector where i can set the AI to run through the way points
    in order, or in a random order, depending on the level situation.

    In both cases, i need to be able to select the way points individual.
     
  2. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302