Hello Unity Forum. I have just started using the Unity tutorials and (yes) am stuck on the first game I’m trying to make. It’s the Rollaball game. Every time I finish writing the coding for the controls and save the file I get an error message in Unity that says
Assets/Scripts/PlayerController.cs(13,27): error CS0120: An object reference is required to access non-static member `UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3, UnityEngine.ForceMode)’
Iv’e been over my coding a dozen times. This is what it looks like this -
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour
{
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis(“Horizontal”);
float moveVertical = Input.GetAxis(“Vertical”);
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
Rigidbody.AddForce(Vector3);
}
}
I can’t find my mistake. Can someone please, pleeeaaaase help me out?
Thanks in advance
-RoofPizza