Hey guys - I have been trying any answer I could find, but I just can’t seem to get my ball rolling. My speed is set to 100, and i’ve got the following script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour {
private Rigidbody rb;
public float speed;
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);
}
}
If anyone could help me out, that’d be fantastic.
,