Hi,
how do I check if the x position is moving? Only the x, not the y/z position.

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

Now that you have had your coffee, don't forget about floating point imprecision:
// @kurtdekker: don't forget about floating point imprecision
using UnityEngine;
public class FloatingPointImprecision : MonoBehaviour
{
void Start ()
{
float a = 2000.0f;
float b = 0.1f;
float product = (a * b);
float answer = 200;
Debug.Log( "a = " + a);
Debug.Log( "b = " + b);
Debug.Log( "product of a*b = " + product);
Debug.Log( "answer …
This will explain it all.
In an IEEE single-floating point number you can represent certain numbers perfectly and unambiguously.
For instance, 0.5f is precisely represented as 0x3f000000
However, 0.1f CANNOT be precisely represented. One possible approximate representation is 0x3DCCCCCD
The analogy is that you cannot show 1/3rd precisely as a decimal.
0.33 is correct to 2 decimal places
0.3333 is correct to 4 places
etc.
But you can never exactly represent 1/3rd as a decimal numeral. Yo…
“Think of [floating point] as JPEG of numbers.” - orionsyndrome on the Unity3D Forums

In addition to what Kurt-Dekker said, if your object has a dynamic rigidbody that is controlled only by physics then you can use the rigidbody’s velocity.x