Restricting "Drag GameObject" script to Z Axis?

I've found a good script that allows the player to drag GameObjects in the game around. However, I've had one problem with it. The object flies towards the camera, and I don't know how to stop it. Thankfully, the game I'm making is a 2D platformmer, and it only needs the objects to move along the Z axis. However, I do not know how to insert this into the script. Can someone help me with this?

The script is here: http://www.unifycommunity.com/wiki/index.php?title=DragObject

Change the `yPos` variable to `zPos`, `addHeightWhenClicked` to `addDistWhenClicked`

And change -

myTransform.Translate(Vector3.up*addHeightWhenClicked);

to:

myTransform.Translate(Vector3.forward*addDistWhenClicked);

and every reference of -

myTransform.position.y

to

myTransform.position.z