Hi everyone, I searched a whole lot on the web but I can’t seem to find a full answer.
What is the best way to rotate a 3D gameobject with the mouse using the new input system?
I use the following action:
And I use the following code:
public void Look(InputAction.CallbackContext context){
Vector2 LineOfSight = context.ReadValue<Vector2>();
Debug.Log(LineOfSight);
if(LineOfSight.x != 0){mousePos.y = LineOfSight.x/(LineOfSight.x*-1);}
if(LineOfSight.y != 0){mousePos.x = LineOfSight.y/(LineOfSight.y*-1);}
Debug.Log(mousePos);
transform.Rotate(Vector3.up * mousePos.y);
}
What am I doing wrong, I can’t find my mistake.
Thanks in advance for all your help!
