Check if x position is moving

The simplest way is to keep a notion of what it was last frame, compare it and if it is “different enough” (see below), there you have it.

Floating (float) point imprecision:

Never test floating point (float) quantities for equality / inequality. Here’s why:

https://starmanta.gitbooks.io/unitytipsredux/content/floating-point.html

“Think of [floating point] as JPEG of numbers.” - orionsyndrome on the Unity3D Forums