Let’s say you have an actor with one (or more) primitive components.
Those primitive components have QueryAndPhysics as ECollisionEnabled type.
Then you call: “Actor->SetActorEnableCollision(false)”
Now if you try to call “Primitive->SetCollisionEnabled(ECollisionEnabled::NoCollision)” on any of your primitives it won’t work,
because this check, at the beginning of the method, “if (BodyInstance.GetCollisionEnabled() != NewType)”, fails.
This means that there is no way of disabling collisions on a primitive when actor collisions are disabled.
Steps:
Call SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics) on a primitive component with
Call SetActorEnableCollision(false)
Call SetCollisionEnabled(ECollisionEnabled::NoCollision) on a primitive component
Call SetActorEnableCollision(true)
Current result:
Primitive component collisions are still enabled as the second SetCollisionEnabled wasn’t applied
Expected result:
Primitive component collisions are still disabled
Also, i think it’s quite bad that there is no way of knowing the ECollisionEnabled type of a primitive component if actor collisions are disabled,
as both UPrimitiveComponent::GetCollisionEnabled() and FBodyInstance::GetCollisionEnabled() always return ECollisionEnabled::NoCollision in that case,
and BodyInstance::CollisionEnabled is private.
I get it that this makes sense for physics behavior, but if you want to use the real ECollisionEnabled type of a component to determine something else in the game, you just can’t.