If you want to use Unity’s new Input System to get the mouse’s position you can use Mouse.current.position.ReadValue()
instead of using Input.mousePosition
Take note that this is a Vector2
private void AdjustPlayerFacingDirection()
{
if (!_hasCamera) return;
Vector3 mousePosition = Mouse.current.position.ReadValue();
var playerScreenPosition = _camera.WorldToScreenPoint(transform.position);
_isFacingLeft = mousePosition.x < playerScreenPosition.x;
_spriteRenderer.flipX = _isFacingLeft;
}
This took some digging in the docs for the new Input System.
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.7/api/UnityEngine.InputSystem.html
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.7/api/UnityEngine.InputSystem.Mouse.html