Search Unity

error CS1014

Discussion in 'Scripting' started by Vashdacool, Aug 4, 2015.

  1. Vashdacool

    Vashdacool

    Joined:
    Aug 4, 2015
    Posts:
    2
    i was doing the tutorial for unity, and when i went to play "roll-a-ball" it gave me this error message. where did i mess up? here is my script.

    1 using UnityEngine;
    2 using System.Collections;
    3
    4 public class PlayerControler : MonoBehaviour {
    5
    6 private Rigidbody rb;
    7
    8 void Start ()
    9 {
    10 rb = GetComponent<Rigidbody> ();
    11 }
    12 void FixedUpdate
    13 {
    14 float moveHorizontal =Input.GetAxis("Horizontal");
    15 float moveVertical = Input.GetAxis("vertical");
    16
    17 Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    18
    19 rb.AddForce (movement)
    20 }
    21 }
     
  2. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    [code ][/code ] tags please. Also, we don't memorize all of the message numbers, so in the future you should include the entire error message. In this case though, I can see that you're missing a semicolon after the AddForce() call.

    Cheers.
     
  3. Vashdacool

    Vashdacool

    Joined:
    Aug 4, 2015
    Posts:
    2
    thanks, will do!