- Home /
Question by
nielsrask · Jan 13, 2011 at 08:06 AM ·
buildbuild-erroraccelerometerfadeblue
Build and Run trouble
Hi guys, I'm doing an application that displays a figure in 3D space, that rotates according to an accelerometer input from a real world object.
Everything works just fine in the editor, but when I do a Build and Run, the object is shown in a flash, but then it fades away and the screen is just blue.
I have narrowed it down to this part of the script:
float bottom = Mathf.Abs(Mathf.Sqrt(Mathf.Pow(x, 2.0f) + Mathf.Pow(y, 2.0f) + Mathf.Pow(z,2.0f))); pitch = (Mathf.Asin(-y / bottom) * (180 / Mathf.PI));
Quaternion temp = Quaternion.Euler(0, 180, pitch);
target.transform.rotation = Quaternion.Slerp(target.transform.rotation, temp, lerpFactor);
Can anyone give me some advice? Thanks in advance!
/Niels Rask
Comment