Child object proper rotation

I seem to be having problems rotating my child object inside my parent. It deforms outside of its collision box and looks horrible.
I have looked around for similar posts and tried to use ‘transform.localEulerAngles’ and ‘transform.localRotation’. Both of these still warp my object.
Here is some a sample of my code:

			float goAngle = Mathf.Atan2(targetRotation.z, targetRotation.x) * Mathf.Rad2Deg;
			Vector3 movAngl = new Vector3(-goAngle, 90, 180);
        	transform.localEulerAngles = movAngl;

The child object has this script attatched to it. Is there a function I should be using to rotate the object properly?


Here is an image of the deformation, goAngle debugs out to 0-180, then -180 to 0 (going in a clockwise direction)

also debug.log goAngle and make sure the result makes sense.

for example if we look at the documentation we see that

X is the first variable and Z is the second.
when they did there example.

flip it