I wanted to make a script which moves an object in the X axis. However I can’t get the Position of the Rigidbody.
I googled and the Unity help told me that a “Rigidbody2D.position” does exist. However I can’t get it working.
Not sure about that, your script looks confusing. You might want to check out this tutorial though, maybe you can find some useful info in the demo scripts.
Edit: Sorry, I think I saw moving platformer. Doh!
I think your problem is that you are mixing RigidBody2D and rigidBody2D. The first one is the class name and the second one refers to the rigid body 2D component. In your script you only want to use rigidBody2D all the time.