- Home /
Rotate player depending on mouse in top down game with rays?
So i have a ray with a ray.direction between origin player and destination mouse position, and i want the player to turn based on that? Any help is appreciated thanks!
Comment
Answer by ahmedbenlakhdhar · Dec 09, 2014 at 10:57 PM
i did this
transform.rotation = Vector3.RotateTowards (Input.mousePosition);
but now i have the following error
Assets/Code/Entities/Player.cs(29,46): error CS1501: No overload for method RotateTowards' takes
1' arguments
and this doesnt work either
transform.rotation = Vector3.RotateTowards (rigidbody2D.transform.position, Input.mousePosition, 5, 5);
it cant convert type vector3 to quaternion