Why won't my ball move in Roll - a - Ball?

In the roll - a- ball project, my ball was rolling fine then mono develop crashed. I could remember where I was in the tutorial. I re-did everything and the ball doesn’t move. I’ve done everything I could, but to no avail. what can I do?

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour
{
public float speed;
public GUIText countText;
public GUIText winText;
private int count;

void start()
{
	count = 0;
	SetCountText ();
	winText.text = "";
}

void FixedUpdate()
{
	float moveHorizontal = Input.GetAxis("Horizontal");
	float moveVertical = Input.GetAxis("Vertical");
	
	
	Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
	
	rigidbody.AddForce(movement * speed * Time.deltaTime);
	
}
// Destroy everything that enters the trigger

void OnTriggerEnter(Collider other) 
{ 
	if(other.gameObject.tag == "PickUp")
	{
		other.gameObject.SetActive(false);
		count = count + 1;
		SetCountText ();
	}
}
void SetCountText()
{
	countText.text = "Count: " + count.ToString();
	if(count >= 12)
	{
		winText.text = "YOU WIN!";
	}
}

}

here is what it looks like in unity. extreme rookie to this. please help.

3 Answers

3

Is Kinematic is checked in the inspector. You want this to be false so the physics work out correctly. When Is Kinematic is checked it won’t take in any forces, Read more about it here.

This is the correct answer. Or at least something that must be done. Have you tried it?

Monodevelop may try to “convert endings” to Windows when you type up your code. You have to select “Keep file endings”

Really? At most I get a warning from time to time about that.

You haven’t added a reference to ‘rigidbody’ yet. Try adding

RigidBody rigidbody;

At the beginning, and then in start, add

rigidbody = GetComponent<RigidBody> ();

Yes, this as well. But still don't neglect that isKinematic cannot be true for the ball.