I started using unity and making Roll-a-ball i finish the script but i get this message
“Assets/Script/PlayerController.cs(18,19): error CS0120: An object reference is required to access non-static member `UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3, UnityEngine.ForceMode)'”
Anyone,can help me ?
This is my script
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
//Use this for initilization
void Start () {
}
//Update is called once per frame
void FixedUpdate (){
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector2 movement = new Vector2 (moveHorizontal, 0.0f, moveVertical);
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
Rigidbody.AddForce(movement);
}
}