I am trying to make my very first game using this script by Sorcerer Studios but I can’t stop it toppling over, when I first started testing it it just stayed upright but now it just won’t stop! Here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float speed;
private Rigidbody rigid;
void Start()
{
rigid = GetComponent<Rigidbody>();
}
private void FixedUpdate()
{
float Horizontal = Input.GetAxis("Horizontal");
float Vertical = Input.GetAxis("Vertical");
Vector3 move = new Vector3(Horizontal, 0.0f, Vertical);
rigid.AddForce(move * speed);
}
}