Something wrong with movement.

I am trying moving an object but have some problem with it.

To work this, i tried those ways blow.

transform.position += new Vector( 0.01f, 0.0f, 0.0f);
transform.position += new Vector( -0.01f, 0.0f, 0.0f);
transform.Translate(new Vector(0.01f, 0f, 0f)
transform.Translate(new Vector(-0.01f, 0f, 0f)

(Actually I have some more.)

Anyways, nothing worked properly.

the problem was the result of destination was not same.

For instance,

the first position of an object is (-0.807, 0, 0)

First, do this

transform.position += new Vector( 0.01f, 0.0f, 0.0f);

then, now pos is (-0.797, 0, 0)

Second, do this

transform.position -= new Vector( 0.01f, 0.0f, 0.0f);

then, I think the pos should be (-0.807, 0, 0).

but, the result is (-805, 0, 0)

Why???

It drives me crazy. Anyone helps me :frowning:

(-805, 0, 0)

Did you make a typo? Could you post the entire function?