Object doesn't move or rotate when collision to others unless using mouse

I have some Objects, Object1, Object2,… When I use mouse to move Object1, I want other objects don’t change anything (not move, not rotate). When Object1 collides to others, I want Object1 doesn’t pass through others, also doesn’t bounce but it stop moving when starting collision. I want it just can slip on the surface of others. And I want Object2, Object3, and so fourth does the same as Object1.
I add rigid body and box collider to these Objects, uncheck “Use Gravity”. When they collide to each other, they bounce and move to infinity.:frowning:
I need some help!
thanks.

Can you give a bit more detail about what is happening in the game? Are you using the Drag Rigidbody script to move the objects or are you using your own code for this?

here is my code:
private Vector3 lastMousePos;
private RaycastHit hit;
private Ray ray;
private bool flag = false;
if (Input.GetMouseButtonDown(0))
{
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, 100))
flag = true;
else
flag = false;
}
if (Input.GetMouseButton(0) flag)
{
hit.transform.Translate(Vector3.right * (Input.mousePosition.x - lastMousePos.x) * Time.deltaTime, Space.World);
hit.transform.Translate(Vector3.up * (Input.mousePosition.y - lastMousePos.y) * Time.deltaTime, Space.World);
}
lastMousePos = Input.mousePosition;

If you animate an object by moving its transform from a script then the physics effects (such as collisions) won’t work correctly. If you want physical behaviour then you should add a rigidbody component to the object and move it using the AddForce function. You can use the Drag Rigidbody script (from Unity’s standard assets) to drag the rigidbody object with the mouse. To prevent bouncing, create a new physic material, then set its bounciness value to zero and its bounce combine mode to Min. If you then add this physic material to the object’s collider, you should find that there is little or no bouncing when it collides with another object.