Per Shape Collision Enabling and Channel Response

Hi,

I have a bodysetup which has multiple shape elements and I’m trying to enable/disable collisions on them individually as well as override some channel responses. I found some convenient functions on the bodyinstance which seem to fill this role.

FBodyInstance::SetShapeCollisionEnabled

FBodyInstance::SetShapeResponseToChannels

When I try to use them however their behaviors are inconsistent. SetShapeResponseToChannels doesn’t seem to work at all while SetShapeCollisionEnabled only seems to function with specific types of queries. For my case it only works for ComponentOverlapMulti but not for ComponentSweepMulti.

Additionally for SetShapeCollisionEnabled to work for ComponentOverlapMulti it requires me to provide a FCollisionEnabledMask when passing FComponentQueryParams it. This isn’t so much an issue for new code but for already existing code like UPrimitiveComponent::MoveComponentImpl I don’t really have a way to provide the mask. Normally there exists UPrimitiveComponent::InitSweepCollisionParams which lets me override the query params but unfortunately it only takes in FCollisionQueryParams and not FComponentQueryParams which is the class that has the mask.

Are these functions still supported? Is there a better way to have this kind of behavior? Are there alternatives like calling functions from Chaos or the physics interface directly that could give me the desired behavior?

Let me know if you need more info!

Simon

Hi Simon,

Not a worry, let me take a quick look into it and get back to you.

All the best

Geoff Stacey

Developer Relations

EPIC Games

Hello,

Anymore news on this topic?

Thanks,

Simon

Apologies Simon,

Can I first check that you are calling RecreatePhysicsState after these changes?

If so, are you able to send a repro in a vanilla version of the engine - this will allow me to quickly check into the specific issue you have and allows instant ruling out of a large number of variables.

Thanks!

Geoff

I might of tried RecreatePhysicsState iirc. It was a bit ago. I will test it out again and if there’s still issues I’ll setup a unreal project I can send to you guys to test it out.

Thanks,

Simon

Thanks Simon,

Let us know when you’ve had a chance to try this, and if this doesn’t work we’ll take a look at the project.

Best

Geoff