Hi
I try to make the character look at mouse position but the character look to other side.
This is my code
But the character see to another direction, in the screenshot the character see to the line green but the right is to see the blue point
I try to make the character look at mouse position but the character look to other side.
This is my code
C#:
void Update()
{
screenPosition = Input.mousePosition;
Ray ray = mainCamera.ScreenPointToRay(screenPosition);
if(Physics.Raycast(ray, out RaycastHit raycastHit, 100, layersToHit)){
charIK.LookAtOffset = raycastHit.point;
transform.position = raycastHit.point;
}
}
But the character see to another direction, in the screenshot the character see to the line green but the right is to see the blue point