'UnityEngine.Vector3' to 'UnityEngine.Quaternion'

Hey everyone, I don’t know what’s wrong with my code here:

transform.rotation = new Vector3(transform.rotation.x + xRotation, transform.rotation.y, transform.rotation.z);

It shows this error:

error CS0029: Cannot implicitly convert type `UnityEngine.Vector3' to `UnityEngine.Quaternion'

The problem that it works with the Scale but shows this error with the Rotation.

Thanks, Oussama.

Unity uses QUaternions for rotation, but you try to give it a Vector3.

This should work:

transform.rotation = Quaternion.Euler(transform.rotation.x + xRotation, transform.rotation.y, transform.rotation.z);