This commit is contained in:
NIMFER 2021-08-23 17:32:37 +02:00
parent 8c84231991
commit ae596b6e7e

View file

@ -52,7 +52,7 @@ public class Dobber : MonoBehaviour
void Move()
{
//new Vector3 for calculating movement values
Vector3 move = new Vector3(0, 0, moveVertical * 100 * moveSpeed * Time.deltaTime);
Vector3 move = new Vector3(0, rb.velocity.y, moveVertical * 100 * moveSpeed * Time.deltaTime);
Quaternion rotate = Quaternion.Euler(transform.rotation.x, moveHorizontal * 100 * turnSpeed * Time.deltaTime, 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;