Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

CS1031 Type Expected error

Discussion in 'Scripting' started by TarotDragoon, Jul 15, 2014.

  1. TarotDragoon

    TarotDragoon

    Joined:
    Jul 15, 2014
    Posts:
    2
    Trying to create a very simple script to move around a basic ship in what is essentially a clone of the asteroids movement system.

    but for some reason I keep getting this error.

    I am still very new to all this so please be gentle with pointing out my stupid mistakes.

     
  2. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    This is what you have:
    Code (csharp):
    1. public class NewBehaviourScript : MonoBehaviour
    2.     public float rotateSpeed = 15f;
    3.     public float acceleration = 15f;
    4.  
    5. {
    6.  
    7.     // Functions
    8.  
    9. }
    This is what you want:
    Code (csharp):
    1. public class NewBehaviourScript : MonoBehaviour
    2. {
    3.  
    4.     public float rotateSpeed = 15f;
    5.     public float acceleration = 15f;
    6.  
    7.     // Functions
    8.  
    9. }
     
  3. TarotDragoon

    TarotDragoon

    Joined:
    Jul 15, 2014
    Posts:
    2
    oh my god I missed the damn bracket again..... I am a terrible human....