i confused , when the object is at 0 rotation ( not rotated yet ) , it giving real value ( 0 ) , but when the object is rotated 180 degree , transform.rotation is giving false value ( 1 ) , this is the screenshot :
If the picture is not clear enough , go here https://i.stack.imgur.com/miWIE.png .
Then this is my script that debugged the code and rotate the object :
void RotateFlip() {
GameObject databasegameobject = GameObject.Find ("database");
database databasechange = databasegameobject.GetComponent<database>();
Debug.Log ("current object rotation is " + theiconarrow.transform.rotation.z + " degree ");
if (databasechange.pengertianmenustate == 2) {
if (theiconarrow.transform.rotation.z == 0 ) {
theiconarrow.transform.Rotate (new Vector3 (theiconarrow.transform.rotation.x, theiconarrow.transform.rotation.y, 180), Space.World);
}
}
if (databasechange.pengertianmenustate == 1) {
if (theiconarrow.transform.rotation.z == 180) {
theiconarrow.transform.Rotate (new Vector3 (theiconarrow.transform.rotation.x, theiconarrow.transform.rotation.y, 180), Space.World);
}
}
}
I don't understand why this thing happened , is this a kind of bug or what ?
I am sorry if this already asked somewhere , but i just don't know how to find it at search engine ( neither here ) .
Extra question ( optional ) : is there any application to build app with easy coding and not an game engine ?
transform.eulerAngles
instead. Or learn how to work with quaternions - both are valid options \$\endgroup\$ – UnholySheep Jan 11 '17 at 8:49