- Home /
Question by
sychoi461 · May 07, 2020 at 07:18 AM ·
rotationquaternionif-statements
Something that needs to work but apparently not
if (Input.GetMouseButtonUp(0) || player.transform.position != offset)
{
draging = false;
gameObject.GetComponent<PolygonCollider2D>().isTrigger = true;
}
if (transform.rotation.z <= 0)
{
draging = false;
transform.rotation = Quaternion.Euler(0, 0, 0.1f);
draging = true;
}
if (transform.rotation.z >= 180)
{
draging = false;
transform.rotation = Quaternion.Euler(0, 0, 179.9f);
draging = true;
}
It happens to work for the first and second if statement but when I say if(transform.rotation.z >= 180) the code transform.rotation does not rotates to 179.9. Does anyone know why this isn't working? @Hellium @AwesomeFaceHD
Comment