- Home /
Quaternion distorts my object
Hi,
so i have this problem. I use this part of code to rotate my object while some mouse button is pressed. It works just fine.
var angles = transform.eulerAngles;
y = angles.x;
y -= mouseY ySpeed 0.02;
transform.rotation = Quaternion.Euler(y, reflector.transform.eulerAngles.y, 0);
but i want to initiate this rotation at start so it doesnt jump to this rotation when you press the mouse button. But when i do it, it completely distorts the object. I dont understand why, because exactly this code works then perfectly without any issue. Object is distorted like on one scale axis, it looks to me like that, but when i check its parameters in inspector only parameter changing is the x rotation as it should.
I would be very grateful for any help as i am totaly lost on this.
Thanks
Luke
Answer by aldonaletto · Jul 16, 2011 at 03:29 AM
When one object has different scales in some axes, its children will get skewed if rotated - the docs mention this in Transform.lossyScale.
Your answer
Follow this Question
Related Questions
Eurlar angles to Quaternion help 0 Answers
Clarifying the ambiguities of rotation in Unity 1 Answer
Why Is Object Rotation Resetting After 90 or -90 Degrees 0 Answers
Turret rotation on one axis problems 2 Answers
eulerAngles not set to zero. 1 Answer