diff --git a/Assets/Scripts/Dobber.cs b/Assets/Scripts/Dobber.cs index 9503e52..356aa0e 100644 --- a/Assets/Scripts/Dobber.cs +++ b/Assets/Scripts/Dobber.cs @@ -47,8 +47,8 @@ public class Dobber : MonoBehaviour void Move() { //new Vector3 for calculating movement values - Vector3 move = new Vector3(0, 0, moveVertical * moveSpeed); - Quaternion rotate = Quaternion.Euler(transform.rotation.x, moveHorizontal * turnSpeed , transform.rotation.z); + Vector3 move = new Vector3(0, rb.velocity.y, moveVertical * moveSpeed); + Quaternion rotate = Quaternion.Euler(transform.rotation.x, moveHorizontal * turnSpeed, transform.rotation.z); //here we apply the movement related to the rotation of player rb.velocity = transform.right * move.x + transform.up * move.y + transform.forward * move.z; gameObject.transform.rotation = transform.rotation * rotate;