Hi, I’m learning unity with a Roll a Ball tutorial and I already have a problem.
I have created the script, which is responsible for moving a ball. The problem is… it doesn’t work.
It is attached to the player. Code:
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUptade()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
}
A proof it is attached:
