- Home /
Question by
Paulo33 · Aug 22, 2014 at 04:39 PM ·
axislocaleulerangles
localEulerAngle.z to a float Y axis
Hello everyone, i have a simple math question, i have a obj and i have the local Z angle of this obj, i need convert this Z angle to Y axis, but remaining LOCAL not global.
I have a WRONG example but i almost came close to what I want with it:
var obj1: GameObject;
var zAxis: float;
var axisAngle: Vector3;
function FixedUpdate(){
obj1.transform.localRotation.ToAngleAxis(obj1.transform.localRotation.z, axisAngle);
zAxis = axisAngle.z;
}
It converts to axis (min = -1, max = 1) BUT it is not as "local" when obj1 changes its rotation X, this float value changes, and I do not want that to happen.
I am creating an object that "balances" the Z axis, and this axis when it rotates, the other object rotates on the Y axis
Comment
Your answer