Good Afternoon, I am very new to Unity and to coding as well. I was following the tutorial for Roll-a-Ball and this is the code that I created for the movement script, but when I run this in Unity I get “All compilers errors have to fixed before you can enter playmode”. When I downloaded Unity it is 5.6.0f3 and Visual Studio 2017.
Any suggestions?
[
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public 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, moveVertical);
GetComponent rb.AddForce(movement);
}