diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index e110952..bb9f2a4 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -4,6 +4,11 @@ using UnityEngine; public class PlayerMovement : MonoBehaviour { + + public Rigidbody rb; + + public float forwardForce = 1000f; + // Start is called before the first frame update void Start() { @@ -11,8 +16,10 @@ public class PlayerMovement : MonoBehaviour } // Update is called once per frame - void Update() + void FixedUpdate() { - + if (Input.GetKey("W")) { + rb.AddForce(forwardForce * Time.deltaTime, 0, 0); + } } }