Object that nothing can go through

Hey guys!

This is only my second day of learning unity but I’ve already learned so much! looking forward to learning more.

Ok, I made a little game with a box that I can click and drag. When I don’t touch it, the box falls to the floor. The problem is that if I drag it down and beyond the floor, it goes right through… is there anyway to fix this?

Second problem: is there anyway to make my box roll on the floor? I tried using

function Update () {
        var hturn : float = Input.GetAxis("Horizontal");
 transform.rotation(Vector3(hturn,0,0));
}

but that doesn’t work…

any help would be greatly appreciated!

If you are moving rigidbodies, you should never set the position or rotation via transform. You should instead use:
rigidbody.ApplyForce (…) or
rigidbody.ApplyTorque (…)
Just have a look at scripting documentation of rigidbody.

Edit: Just found out where I saw such a script (by Eric5h5) http://www.unifycommunity.com/wiki/index.php?title=DragObject

thank you very much!