Im pretty new to unity, but this thing has been bugging me for a bit.
if(posZ < max){
transform.position += new Vector3 (0, 0, Time.deltaTime * cubeMoveSpeed);
}
say the max is … 3, what will happen is that the object will move smoothly to 3.013413241 …
So while it is at 3.0 or 3.1, within that range anyway, it will not exactly stop at 3.00000
… so is there anyway to fix this?
I was thinking you could potentially check if the object is in very close proximity to a number and then just place it exactly there but… that sounds like unnecessary work, but who am I to know… im just getting started learning.