Hi - I’m a beginner to Unity3D and I started with the Roll a Ball game. I find that I’m not able to move the ball in Play mode even though I’ve set everything up correctly. This is how the ball is set up:
Also, this is my PlayerController code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
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);
}
}
I’m not sure what I’m doing wrong here. Could I be missing something in my initial installation which would prevent me from running the program?
Thanks in advance!