Rotation is just.... wrong

tRotationX is a float and target is a game object. There is no other scripts influencing these variables. Is there a reason that tRotationX always seems to = something no where near the target GameObject’s x rotation?

tRotationX = target.transform.rotation.x;

EDIT: The GameObject Is a camera

Do not use a single axis from Transform.rotation unless you understand quaternions. The .x element from Transform.rotation is not the x axis; quaternions are 4D and have x, y, z, and w, where each element is normalized, not in degrees. You probably meant transform.eulerAngles instead, although reading a single axis from eulerAngles is not recommended, since there is more than one correct way to convert quaternions to eulerAngles (e.g., (0, 0, 0) is the same as (180, 180, 180)) and there is no guarantee that any one axis will be converted the same way every time.

maybe u need the local rotation and not the global? like target.transform.localrotation.x…not sure if this is even valid but thats my guess

var rotation : float;
var tRotation : float;
var tRotationX : float;
var velocity : float = 0;
var smoothTime : float = 0.3;

function Update () { 
tRotationX = target.transform.localRotation.x; 
rotation = transform.rotation.x; 
tRotation = Mathf.SmoothDamp(rotation, tRotation, velocity, smoothTime, Mathf.Infinity, Time.deltaTime); 
transform.rotation.x = tRotation;
    
    }

i’m not seeing anything weird here. no matter what the rotation is it should obviously be copying its value to tRotationX. i would slap a bunch of debug logs everywhere and see where and when the value differs. or step through debug. i dont think this is solvable without the seeing the whole project. im sure u’ll figure it out though

i dont think this is relevant to ur question, but i see at the end of the update you have transform.rotation.x = tRotation. Is this a valid statement? is that doing anything? i use c# and when working with assigning transforms i swear i have to manipulate the transform.position or rotation in its entirety. At least positions i know for sure. I would have to set all 3 or 4 float values by declaring the entire Vector3 or Vector4, I couldn’t manipulate just one vector of a Vector3. so in ur case when u change rotation.x it would be like transform.rotation = Quaternion.euler(tRotation, transform.rotation.y, transform.rotation.z);