Question by
bamared90 · Mar 15, 2017 at 08:28 PM ·
erroreditor-scriptingbuild-erroraddforce
Assets/Script/PlayerController.cs(22,3): error CS1525: Unexpected symbol `rb'
I am following a tutorial and i have followed it to a "t" but this is the error i am getting Assets/Script/PlayerController.cs(22,3): error CS1525: Unexpected symbol `rb'
This is my current script:
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PlayerControler : MonoBehaviour {
private rigidbody rb;
void start ()
{
rb = GetComponant<Rigidbody>();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical)
rb.Addforce (movement);
}
}
Comment
Answer by Commoble · Mar 15, 2017 at 08:37 PM
You're missing a semicolon (a ;) at the end of the third line in FixedUpdate.
While you're at it, change rigidbody to Rigidbody and start to Start. Capitalization matters.