Hello everyone, brief question. I have a script, for a game object that will move down, sideways and up depending on where the player is, like a mario Thwomp, but in 4 directions. I currently have a public static float of the players X co-ordinates and Y co-ordinates, and I want it to start moving when I go under one, for this however I made it so the player X has to equal the Thwomps X in order for it to fall, but I want it to fall down if the player is anywhere +1 or -1 to it on the x co-ordinates as well, so it will actually move down as currently it is incredibly hard to get the X co-ordinates to line up, as they are floats.
TL;DR
I need to be able to move an object down + or - 1 of its current x co-ordinates.
(I am coding in C#)