How to rotate object's y-axis with mouse position on screen ?

Hi every one. I’m making a third person game. When I move cursor, I want to player rotate y - axis with mouse position on screen. Anyone have a idea ?


For 3D games:

Take a look at this:

For 2D games:

Follow this thread: 2D look at mouse position (z rotation) [c#] - Questions & Answers - Unity Discussions


Make your life easier and follow this Youtube tutorial: Unity C# - How to face the mouse position in 2D - YouTube

Hope this is what you need. Cheers!