Hi everyone!
I have some problem with rigibody. I want make it work like image below, and only want use rigibody make it work like that, without bouncing after pushed by another cube.
If can’t do that, please help me write code.
Thank you so much!
P/S: Sorry! my English is bad.
1 Answer
1I think you have a problem with Newton
Because you have 2 rigidbody and you want to collide these and than to glue them each other. In real World this is imposible with rigidbody. But you can do it what you want in Unity.
You should detect collision. When collision is detected, you make your cubes velocities equal. You can do this via script to reach rigidbodies velocities directly. Before do these things you must know what you want exactly. You must think motions of cubes after gluing process.

Add rigidbodies and box colliders to both cubes.
– tanoshimiThank you, can you tell me variable of Rigibody and box colliers? Because after it was bouncing up and station and not move horizontally cube2
– trongtd1988you are doing something wrong
– Cow-NecromancerReduce friction on the ground surface and increase mass of the cubes.
– tanoshimiyou shouldn't allow to collide rigidbodies! you can use second collider ,larger than your rigid body, and when this collider is trigered you should set your cubes position and velocities. it is going to seem collision whic you want.
– mustafakemal