Lookat mouse, without raycasting?

Is there a way to make the player look at the mouse without using raycasting?
For instance, if our player is walking along a narrow platform in a tds, it wont look at the mouse unless the mouse is over the platform?

Would there be a way around this? If you’re giving examples could you please give them in C#, much appreciated.

Carl

additional info

Apologies I meant rotate the player! i tried to have a go at using the raycasting but i couldnt get it working,

transform.rotation = Quaternion.Slerp(transform.rotation, 
                       Quaternion.LookRotation(hit.point - transform.position), 
                       rotateSpeed * Time.deltaTime);

I’d say, just create a plane (invisible, behind all your other objects, parented to your camera so it moves with the player character) and raycast to that. There won’t really be much code difference associated with that change and you’ll always be guaranteed to hit something.

You dont need a real plane nor any raycasting at all. Just use Camera.ScreenToWorldPoint, noting that x,y is mouse and z is distance from camera to an imaginary plane where you want the player to look. If this plane is not fixed, calculate the distance from the players current z distance.