It works perfectly as long as the camera is above the player, in a 90 degree angle.
But my problem is that i would like the camera to be rotated on one axis (kind of a mix betweentop down and 3rd person), and that makes the player rotation a bit off on that specific axis (See the picture below)
The ( Screen.height / 18 ) makes it fit kinda nice, but as you probably already know, this gives a little bit of a problem if the players has the cursor really close to the player, and it is still not perfect centered at the cursor all the time.
I don’t quite understand your question. The script you linked to should work regardless of the camera angle, provided the object position is visually aligned with where you imagine the cursor to be in 3D space. In your case, it looks like you want that yellow beam or whatever to intersect the cursor — so, you must ensure that the player’s Y position is equal to the Y position of the beam.
This matters because the playerPlane in the script is defined at the transform.position of the object you attach it to.
From your screen shot, I’d guess that the player’s Y position is at his feet, not his beam. So, the player is rotating so that his feet are pointed right at the cursor. The beam then appears to go over the cursor, as you would expect.
A simple and nice enhancement to this script would be to make a public float property “planeY” that defines the position of this plane instead. Then you can set it independent of the Y position of the object it’s rotating. By tweaking this Y position up to match the position of the beam, you should be able to get it dead on.