Physics Question

I have two objects that I want to be able to hit walls so they both need to be rigid bodies.

I want to be able to destroy the second object on contact without applying a force on the first.

is this possible through script?

I don’t use FU physics anymore, but I used to and I believe once you’ve been notified of a collision, it has already been resolved and it’s too late to just destroy one of the objects without affecting the other.

But what you could do is put the existing colliders on non-interacting layers, and add a trigger collider to one of the objects that you use to figure out when to destroy.

thats what I ended up doing. ah, one more layer of complexity to manage!

thanks Smooth P.

Far simpler:

Every fixed update, store the position, rotation, velocity and angular velocity of the first object.

When you receive a onCollisionEnter signal and it is the second object, simply restore the last position, rotation velocity and angular velocity. You will then need to add those forces by hand back in.

position = positon + velocity * Time.fixedDeltaTime;
angles = angles + angularVelocity * Time.fixedDeltaTime;

Its a cheap way to do it. It may not be perfect in the end, but it will resolve correctly.