I keep encountering the same problem over and over and over and over again. I have the script for the player to move the ball, but every time I press play, it moves on it’s own, but I can still control it, but it will constantly keep moving upleft away from the camera whilst looking at the ball on the grid. I check my script, and it’s correct, I change it a little (I’m still a beginner script writer) and I corrupt my script. I just can’t seem to not get the ball to move on it’s own. I really need help.
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);
}
}