Roll a Ball tutorial error

Here goes a rally stupid question, but I’ve tried everything I could thing of and everything I’ve read on here, and nothing works.
I’m currently doing the ‘Roll a Ball’ tutorial and I’m onto the 2nd video, around 9:30 in.
Despite typing word for word what the tutorial says, and after fixing it with the help from other questions, I still get this error:

"Assets/Scripts/playerController.cs(13,35): error CS0120: An object reference is required to access non-static member `UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3, UnityEngine.ForceMode)’ "

It’s driving me crazy… I’ve corrected all the spelling mistakes I could see and read about on here. Typing rigidbody in lowercase made the error stop. But I can’t move the ball.

Heres my code:
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(movement);
		}
	}

Thanks.

rigidbody.AddForce(movement);

(Note the lowercase r. RigidBody is a class, rigidbody is a member of type RigidBody that belongs to the game object.)

Hey Crashmast,

If your using Unity 5, then here is your problem:

The tutorial is outdated, so you need to save the Unity Mono-develop, then close it.

Return to unity, in the Assets options drop-down box (up the top, near File, Edit etc.), click Run API Updater…. It will recommend that you make an backup, up to you whether or not you do.

This should fix your problem.

If your using unity 4 or later, then I can’t help you sorry.

Setho246

The correct syntax in Unity 5 is

GetComponent<Rigidbody>().AddForce(movement);

You’ll also have some trouble with GUIText later in the series. See this video for a fix.

using UnityEngine;
using System.Collections;

public class playercontroller : MonoBehaviour {

//public float speed;

 public Rigidbody rb; 

void start()
{
	rb.GetComponent<Rigidbody> ();
}

void FixedUpdate()
{
	float moveHorizontal = Input.GetAxis ("Horizontal");
	float moveVertical = Input.GetAxis ("Vertical");
	Vector3 movement = new Vector3 (moveHorizontal, 0.0f,moveVertical );
	
	GetComponent<Rigidbody>().AddForce(movement);

}

}
my code is this.
and problem is :Cleaning up leaked objects in scene since no game object, component or manager is referencing them
MonoScript has been leaked 1 times.