Top Down Rotate Script

Hi, so i have been working a bit on a top down arena shooter.
I have a basic script that rotates the player towards the mouse and that follow the player when he moves around.

private var worldPos : Vector3;
private var mouseX : int;
private var mouseY : int;
private var cameraDif : int;
var playerObject : GameObject;

private var playerX : float;
private var playerZ : float;

function Start () 
{
    cameraDif = camera.transform.position.y - playerObject.transform.position.y;
}

function Update () 
{

	playerX = playerObject.transform.position.x;
	playerZ = playerObject.transform.position.z;
	transform.position = Vector3(playerX, 13, playerZ);
	
    mouseX = Input.mousePosition.x;
    mouseY = Input.mousePosition.y;
    worldPos = camera.ScreenToWorldPoint(Vector3(mouseX, mouseY, cameraDif));
    playerObject.transform.LookAt(worldPos);

}

The script calculates the distance from the camera and then checks for the mouse position on the screen. The script then removes the distance from the player to the camera to have the player rotate in the right Y position and then makes the player rotate at the position where the mouse is.
The script is working fine except for one problem that i have.
When i mouse of the player he starts looking down as if the mouse is under the player for some reason. I think it might have something to do with the pivot point but i have tested around and did not find a sollution. Do anyone have any clue how to fix this?

Thanks for taking your time to read this post.
// Former Known As

I tried the code, i think the problem is with the camera, where ever the playerObject is the camera is going 13 unit up in position at Y axis. I think you must tweak some think with camera position when game starts. . . . That’s what i found.

Oh my god i’m dumb…
Read your post and quickly checked the camera position in the inspector and in the inspector the camera had 14 units in the Y axis. So that meant that the script did the function start where the script checked the distance from player and set it to some number. Then the script changed the Y axis to 13 (I forgot to set it as the same as it was in the inspector) which screwed it up.
Thanks for such a quick reply sushanta.

its ok man