How can i move an object while the coursor is locked?

I have an object that follows the mouse position(x,y) and works perfect until i lock the cursor which then just sits in the center of the screen. I need the object to move based on the x,y coordinates of the mouse while the cursor is locked, any ideas would be awesome.

You don't want to lock the cursor, you just want to hide it.

Use Screen.showCursor = false;

http://unity3d.com/support/documentation/ScriptReference/Screen-showCursor.html