Object rotation problem PLEASE HELP !

Well i have my camera rotate based on the mouse position then adjust the players rotation

target = Quaternion.Euler(0 , rotationObject.transform.eulerAngles.y, 0); // rotationObject is the camera
if(Input.GetAxis(“Vertical”) != 0){
player.transform.rotation = Quaternion.Slerp(player.transform.rotation, target, Time.deltaTime * smooth2);
}

Then in the player controller script iv got continuous rotation 360 ° based on the Horizontal axis

function Turn(){
if(Speed > 0 Direction >= 0.1){
rigidbody.transform.Rotate(0,6.0WalkRotationPerMinuteTime.deltaTime,0);
Debug.Log(“Workkk”);
}

if(Speed > 0 Direction <= -0.1){
rigidbody.AddRelativeForce(0,-6.0WalkRotationPerMinuteTime.deltaTime,0);
Debug.Log(“Workkk”);
}

}

Now the problem is that with the camera controller active when i try to turn on the horizontal axis it dose not do it properly
I need to find a way that both values work at the same time and not them overight eachother hope you understood me sry for my english
http://postimg.org/image/fqmdb3b7n/

You can’t just separate the x, y, and z of a rotation like you’re trying to do because of the way Euler angles work.

At some point you’ll want to learn why that is and how to properly manage rotations.

But the basic pattern here would be to use separate transforms for yaw and pitch (y and x in Euler) and make the pitch transform a child of yaw.

I just want to add this, because it’s one of my favorite Euler-related videos on Youtube:

That’s an excellent video, toreau.

Well thx for answering but i dont rly understand it would be easyer if you can show an example in script