var player : Transform;
function OnMouseOver ()
{
if(Input.GetButtonDown("Fire1"))
{
transform.localScale += new Vector3(0F, .1F, 0);
}
if(Input.GetButton("Fire2") && transform.localScale.y > .1f)
{
transform.localScale += new Vector3(0F, -.1F, 0);
}
}
I’m using this script to increase scale on object by .1 when I left click and decrease scale by .1 when I right click. When the object’s scale gets above 2.7, it goes to 2.799999 instead of 2.8. Why is this happening and is there a way to prevent it from doing so?