I have solved it.
Roll a Ball - Moving the Player - Ball Not Moving
I have been following the tutorial, Roll A Ball and have progressed up to the point of the "Move the Player" section. I have used the script from the tutorial page and have assigned it to the "Player" object. The ball is not moving. When I press play, I can see the player button turn blue, and the game enter playmode, only the ball does move what so ever. I do not recieve any errors in the script either. All help would be much appreciated. Thankyou.
Here is the script I am using in the 'Player' object.
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
private 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);
rb.AddForce (movement * speed);
}
}
What value did you assign to the variable "speed" in the inspector?
I changed the speed value to many different values and it still did not move.
I changed the speed value to many different values and it still did not move.
The solution is to uncheck "Is $$anonymous$$inematic" and "Use Gravity" under the rigidbody component tab.
Hope this helps someone, as I searched for a good hour before figuring this out.
:)
Same problem I had. "Is $$anonymous$$inematic" somehow became checked for the player object. I spent an hour wondering why the ball no longer moved before comparing my Inspector settings with what was on the tutorial screen. On the bright side, I learned what kinematics is by reading the Wikipedia article about it. The short description is that it is a branch of mechanics that describes the motion of "bodies without consideration of the masses of those objects nor the forces that may have caused the motion." Not what we are doing by applying a force to a rigid body with mass.