- Home /
This question was
closed Oct 06, 2014 at 01:30 AM by
robertbu for the following reason:
Duplicate Question
Question by
gannaz · Oct 06, 2014 at 01:30 AM ·
scripting problemscript errorscriptingproblem
error CS1525: Unexpected symbol 'rigidbody'
My script is as followed. I am just stumped at why this is happening because I am just getting my player to move and this came up?
using UnityEngine;
using System.Collections;
public class Playercontroler : MonoBehaviour
{
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical)
rigidbody.AddForce(movement);
}
}
Comment
Answer by robertbu · Oct 06, 2014 at 01:31 AM
You are missing a ';' at the end of line 11.
Assets/Scripts/AresControls.cs(12,33): error CS1525: Unexpected symbol `rigidbody'
this happened to me too here's the script:
using UnityEngine; using System.Collections;
public class PlayerController : $$anonymous$$onoBehaviour {
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical)
rigidbody.velocity = (movement);
}
}