how does a non-rigidbody affect a a rigidbody?

I got these 2 cubes, the red one is a rigidbody, and the black isnt, and i move them towrads eachother using the translate funciton.

Here i stop the red one, and the black one goes right through it, so it seems like the conclusion is that non-rigidbodies doesnt affect rigidbodies.

Here i just move them towards eachother, and the black one is pushing the red one, so it seems that non-rigidbodies actually affect rigidbodies.

I dont really understand why the difference in behaviour, why is it pushing the moving one, but not the non-moving one?

Not exactly a master of Unity’s physics, but in order for objects to repelle each other (pushing) they should be moved using the actual physics engine, with Forces, or you can just directly manipulate the object’s velocity.

Try this and see how it works.

You have the GameObject, and every game object has a transform which are the position, rotation, and scale.

The box you actualy see is the mesh component rendered by the renderer component, but it doesnt really collide with anything, its just for shows, lol.
The mesh has all the triangle info, but the renderer is the one in charge of showing it on the screen.

A completely separated thing is the collider.
The Colliders are the ones that let Unity know when stuff is colliding. But it doesnt do anything on it’s own. Rigidbodies by default collide against any collider in the scene, but you can override that with a script if you need to. Also, you can add scripts with OnColliderEnter, OnColliderStay and OnColliderExit, check the script reference.

The rigidbodys modifies de Trasform Component(position rotation) adding physics to it. Rigidbodies need a collider to know when they’re colliding with other colliders. If you don’t give it a collider, they’d just fall down for ever.

I still dont understand this, would really appreciate if someone culd explain it to me.

Heres what i do:

I make two cube, and make one of them a rigidbody, while the other is not.

I dont use any scripts to manipulate the rigidbodys, to put force on them or anything.

Then i send the non-rigidbody towards the rigidbody by using Translate in the Update function.

And my question is, what is supposed to happen now? Is the non-rigidbody supposed to push the rigidbody or not?

I seem to get random behaviour, for example if i change the speed of the non-rigidbody it will sometimes push the rigidbody, and other times just go through it.

If your using physics bodies, then use the physics commands go move them, like AddForce, etc. The physics simulation and the display are not run at the same speed, so you get weird behavior if you use Translate, etc to manipulate physics bodies. If you have a non-rigid body collider, it won’t be moved by the physics engine, but it will affect the physics simulation. So if you’re using physics commands, it will stop a rigid-body. If you are moving the collider (which you shouldn’t really do) it may affect the rigid body, it really depends on the timing and when the next physics update happens, and if the rigid-body is asleep since a non-rigidbody collider won’t wake up a sleeping rigid body.

Basically, if you want physics, use the physics engine to move rigid bodies. Non-rigidbody colliders should be used for non-moving things like walls, floors, etc. If you really want to use Translate on a physics body, use a kinematic rigidbody. Kinematic rigidbodies can exert huge forces on a rigid-body though, so it’s quite possible it will go flying away unrealistically.

Most importantly, read the manual. http://unity3d.com/support/documentation/Components/comp-DynamicsGroup.html will answer a lot of your questions.

Thanks man, yeah it probably has to do with the physics and the display being out of sync.

Your specific situation probably has more to do w/ the rigid body going to sleep. When it goes to sleep it’s taken out of the physics simulation to keep performance good until something happens to wake it up. Then it starts being simulated again. A non-rigid body collider won’t wake up a sleeping rigidbody.