Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Help] Scripting Overview, Controlling GameObjects Using Components question.

Discussion in 'Documentation' started by silvermirai, Aug 12, 2017.

  1. silvermirai

    silvermirai

    Joined:
    Jul 26, 2017
    Posts:
    1
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    Transform implements IEnumerable. When you iterate over a transform, you get all the children of that transform (one level deep).

    So that bit of code simply sets the waypoint array to be all the transform children of the transform the scipt is attached to. It's a bit convoluted.