Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

http://docs.unity3d.com/Manual/ControllingGameObjectsComponents.html

Discussion in 'Physics' started by Shuttle, Dec 25, 2014.

  1. Shuttle

    Shuttle

    Joined:
    Dec 25, 2014
    Posts:
    4
    when create this script:
    Code (CSharp):
    1. public class WaypointManager : MonoBehaviour {
    2.     public Transform waypoints;
    3.    
    4.     void Start() {
    5.         waypoints = new Transform[transform.childCount];
    6.         int i = 0;
    7.        
    8.         for (Transform t in transform) {
    9.             waypoints[i++] = t;
    10.         }
    11.     }
    12.  
    13.        }
    http://docs.unity3d.com/Manual/ControllingGameObjectsComponents.html
    catch errors
    Assets/Scripts/NewBehaviourScript.cs(8,27): error CS1525: Unexpected symbol `in', expecting `)', `,', `;', `[', or `='
    Assets/Scripts/NewBehaviourScript.cs(10,9): error CS1525: Unexpected symbol `}', expecting `)', `,', `;', `[', or `='
    Assets/Scripts/NewBehaviourScript.cs(13,7): error CS8025: Parsing error
    why?