Use Public Variables

Your speed is a 10 buried inside the script. To change it you would open the file, edit the number, save, and wait for Unity to compile. That is a lot of work for one number, and you will change this one many times before the game feels right. This node moves it into the Inspector, where you change it with your mouse.

More in Write Your First Script

  1. Start and Update
  2. Fix a Compile Error
  3. Move With Code
    1. Why Time.deltaTime
    2. What a Vector3 Is
    3. Use Public Variables

All 54 topics in the Your First Unity Game