"If" Statement

I used this code to make that if the rotation is less than 45 then rotation in Z axis is equal to 0 but doesnt matter if it is less than 45, if i Input.GetKeyUp(“a”) it allways run the code so i dont want that, please if you can improve my code, im newbie. Help, Thanks.

if (transform.rotation.z <= 45) {

if (Input.GetKeyUp (“a”)) {

transform.eulerAngles = new Vector3 (0, 0, 0);
}

}

Unity upscaled the image. A 8K image would be around 64MB each so yeah. Size increases exponentially as you increase resolution

Original size doesn't really matter as Unity will pack the image again. Truecolor is basically without any compression. Best thing would be if your image would be POT like 8192x4096 and then use compressed format.

1 Answer

1

transform.rotation is a quaternion. So quaternary.rotation.z does not represent degrees of rotation in the z axis.
You probably want transform.rotation.eulerAngles.z