Rotate player in direction of movement
This commit is contained in:
parent
79354a9c85
commit
a897138a9e
1 changed files with 2 additions and 1 deletions
|
@ -33,8 +33,9 @@ public class Player : MonoBehaviour
|
|||
Vector3 moveDir = new Vector3(inputVector.x, 0f, inputVector.y);
|
||||
transform.position += moveDir * moveSpeed * Time.deltaTime;
|
||||
|
||||
Debug.Log(inputVector);
|
||||
float rotateSpeed = 10f;
|
||||
|
||||
transform.forward = Vector3.Slerp(transform.forward, moveDir, Time.deltaTime * rotateSpeed);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue