Dragging around an object?

Okay, so this might be really simple and I’m just a noob, but basically what I want to do is something like ROBLOX’s build mode where you can drag an object around the screen with your mouse, and say right behind it is a wall, instead of just sitting in front of you it’ll snap to the wall, and when you let go of it it’ll stay (so no rigidbody).

How would this be done with Unity3D?

Okay @lithileix, Everyone’s a noob when they just start fresh. What you should do is try to learn some tutorials and get into unity.
See Here : https://unity3d.com/learn/tutorials
And as for the Dragging here’s what I offer :

var screenSpace;
var offset;
 
function OnMouseDown(){
    //translate the cubes position from the world to Screen Point
    screenSpace = Camera.main.WorldToScreenPoint(transform.position);
     
    //calculate any difference between the cubes world position and the mouses Screen position converted to a world point  
    offset = transform.position - Camera.main.ScreenToWorldPoint(Vector3(Input.mousePosition.x,Input.mousePosition.y, screenSpace.z));
   
}
 
/*
OnMouseDrag is called when the user has clicked on a GUIElement or Collider and is still holding down the mouse.
OnMouseDrag is called every frame while the mouse is down.
*/
 
function OnMouseDrag () {
 
    //keep track of the mouse position
    var curScreenSpace = Vector3(Input.mousePosition.x, Input.mousePosition.y, screenSpace.z);    
 
    //convert the screen mouse position to world point and adjust with offset
    var curPosition = Camera.main.ScreenToWorldPoint(curScreenSpace) + offset;
 
    //update the position of the object in the world
    transform.position = curPosition;
}

I found this after searching in the forums, Here’s the whole discussion :
http://forum.unity3d.com/threads/drag-drop-game-objects-without-rigidbody-with-the-mouse.64169/

I take no credit for this.

Thanks. Have a nice day. Cheers!

All thanks for my friend which make me believe in shut down windows 10 which is becoming so typical to me.