- Home /
CS1502 and CS1503 Error
I really new a coding. Despite the easier languages and programs, I decided to learn unity and c#. I'm watching a video on how to make a "survival shooter" by unity themselves and i came across an error that said, "Assets/Scripts/Player/PlayerMovement.cs(51,41): error CS1502: The best overloaded method match for UnityEngine.Rigidbody.MovePosition(UnityEngine.Vector3)' has some invalid arguments" and "Assets/Scripts/Player/PlayerMovement.cs(51,41): error CS1503: Argument
#1' cannot convert UnityEngine.Quaternion' expression to type
UnityEngine.Vector3'"
My code was:
Quaternion newRotation = Quaternion.LookRotation (playerToMouse); playerRigidbody.MovePosition (newRotation);
I keep getting the error on the "playerRigidbody" part. Hope anyone can help, Thank You.
playerRigidbody.$$anonymous$$ovePosition accepts a position (Vector3 which has 3 parts x, y, z) to move to. The code provided ins$$anonymous$$d passed newRotation, a rotation (Quaternion which has 4 parts w, x, y, z).