The following is from the immediate window, I paused the program and evaluate the value.
Basically i need to compare the ‘x’ coordinate, i always use RoundToInt when i do any rotation or movement so their x y z coordinate must be an integer. I just dont understand why goEach.transform.position.x == 1 returns false.
Long story short:
You should not rely on float comparisons as they’re not accurate and will fail quite often.
Mathf.RoundToInt(…) returns an integer. Integers can be compared using ‘==’ as there is nothing like imprecision.
If you still want to compare float values, consider using Mathf.Approximately for that.