How to Touch Drag 3D Objects

New to Unity and Scripting… I would like a simple example of dragging a 3D object by touching the screen. I would like the object to stay under the users finger when moving. I am either terrible at searching or there aren’t many simple examples out there (probably the former).

(I would then like to restrict the drag movement to the xz plane but I will add this as a separate question.)

See http://unity3d.com/support/documentation/ScriptReference/Collider.Raycast.html. You would implement an OnMouseDrag handler in a script to set the position. To keep it in xz, just set the y component to 0 (or whatever constant you want).

I’ve made a tutorial recently for touch and drag objects in unity on my blog. See if it helps you in solving your problem. Link - Newtonians' Blog 3D: A Simple and Efficient Touch And Drag RigidBodies For Unity 3D (Beginner Friendly) - Part 1