Here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController: MonoBehaviour
{
private Rigidbody;
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.velocity = movement;
}
}
for some reason, it says the semicolon after private rigidbody isn’t suppose to be there. Can someone please help? This script is in c#.
rb is not defined anywhere.
you probably meant to do this:
private Rigidbody rb;