Disable collision after simulate physics

Hello everyone. I hope this is the right place to post this.

I am working on a side scrolling shooter in 2.5D.

When I shoot and kill my enemies, they ragdoll, which is pretty neat. The problem is, since my character can move only on the X and Z axis, the ragdolled bodies get in the way and weird things happen like shooting my character across the map and weird behaviour if I walk over them.

Is it possible to disable all type of collision while keeping the simulated physics? I.E.: I want my character to be able to walk through these ragdolling bodies.

I have tried several ways of using the Set Collision Enabled node on my AI character. It works for the capsule component (will stop registering hit/overlap) but If I do it for the mesh, the AI character just stops moving entirely. I do destroy my actor after a few seconds just for conveniance but I’d like to be able to walk over them as if they were’nt there.

Thanks!

Sure, this is very easy to achieve. Instead of disabling collision (which cannot be done if you want to simulate physics), you simply need to change the collision response to ignore your pawn.

Under the collision settings on your collision volumes you will find a “Collision Presets” drop down, inside you will see there is the current objects type, and a list of object responses to types, that are set to either “ignore, overlap, or block” each channel. By default it will probably be blocking pawn.

So when your enemy dies you can get its collision component and call “Set Collision Response to Channel”, and change the pawn channel to ignore.

Also make sure your characters mesh and collision is the object type of “Pawn”.

Hope this helps!

3 Likes

Oh wow it did work! Thanks a ton!!!

You’re welcome! I’m glad I could help, and that you got it working! All I ask is that you please mark my answer as correct so that others with the same issue can find the solution too :slight_smile: Thanks

Why can’t the collisions be disabled while simulating physics? I don’t see how a collision response would have to be required for something to still simulate for things like physics constraints and basic kinematics.

1 Like