One way physical forces during collision?

I have a situation where a boulder is rolling down and pushing away rigidbodies as it roles. The rigidbodies are kinematic until ‘oncollision’ is called afterwhich the kinematic value is set to false so they get pushed by the boulder.

When a boulder hits these rigidbodies it often slows down for a bit before continuing on again.

What I would like is the boulders forces to apply to the rigidbodies but for any stopping power the rigidbodies have to be nullified.

Any ideas how I can do that? Currently I just add extra force to the boulder but that makes it look very unrealistic at times.

So far, I know of no way to do this that doesn’t involve faking the large boulder’s physics in some way.

So, try something like this: Make a kinematic rigidbody (with a collider), that is a child of the boulder. It should have the same shape, so that it will collide with objects in the same way.

Then, put all your ‘detritus’ objects on their own collision layer- they should collide only with the floor, and each other (not the big boulder!).

Having done that, make the second collider on the boulder (the fake one) collide with the detritus- so that you have the main boulder actually acting with physics, and the fake boulder pushing all the little things away before it!

Basically, the answer is clever manipulation of collision layers.

Well what you are wanting to do doesn’t happen in real life, so the physics engine probably wouldn’t like that. You could try tricking it like Kieren said, however I would imagine you could also increase the boulders mass. Changing the mass won’t change the rate at which it “falls”.

If the boulder is massive compared to the things it is hitting will have the collisions have a smaller impact on the boulder. The documentation suggests that you don’t make anything more than 100 times more massive than something else. So if you have not changed the default mass of your your other objects, go ahead and try setting the boulders mass to 100 (you may need to change the force you are pressing the boulder with).

are you using C#? Add this:

rigidbody.Addforce(Vector3.down * 500);

I am fairly new to rigidbody scripts, but I beleive you add an ‘if’ statement testing a collision, leading to a rigidbody force. I’m sorry if this isn’t specific enough, but I hope it helps! :slight_smile: