i am trying to move an object up for 60 frames and then move it down for 60 frames, so it should go back to its original place. However, when i tried to do that, thats not what happened. the initial position of the object was (0,1.2,0) and after i moved it up and down, it backed to the position of (0,1.200001,0). This is the script that i wrote for the object.the object is a 3d cube with a box collider.
private float upCounter = 60; private float downCounter = 60; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (upCounter > 0) { transform.position += new Vector3(0, 0.5f, 0); } else { if (downCounter > 0) { transform.position -= new Vector3(0, 0.5f, 0); } downCounter--; } upCounter--; } Its important for my project that those position will be precised. How can i solve it? Thanks the helpers anyway.