How can I disable collisions using code?

Hello.

I’m searching for analog of editor’s Collision Presets in C++. I’ve tried

MyComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision);
MyComponent->SetCollisionObjectType(ECollisionChannel::ECC_WorldStatic);

with no luck

Maybe I’m a bit late and wrong, but I tried

MyStaticMesh->SetCollisionProfileName(TEXT("OverlapAll"));

And it works… But it would be great to get an answer from a developer who knows it. :slight_smile:

1 Like

Hi guys,

Also you can try to use
MyActor->SetActorEnableCollision(false);

Best regards,

2 Likes