Yeah I meant thinking of different setups! Because I agree, that one scenario is trivial, but it isn’t enough to fully understand how everything works.
Ok, so that makes sense, and if I understand you correctly: actors can collide with a mesh component if and only if it has a bounding box, unless UE updates the engine code to change that. Which it looks like they haven’t decided haha.
In addition, it seems to treat every component separately, and will do a blocking collision with the first component it hits (if blocking collisions are chosen instead of overlap/ignore).
So based on that, I think we should be removing collision boxes for the tank and tower pawn’s mesh, so that only the capsule component is having collision calculations done. That is, if we wanted to improve efficiency.
I found some interesting things too!
You can’t generate hit events when colliding with actors attached to an actor via AActor::AttachToActor. I tried grouping actors together with this so I only had to call one set location function, but none of the attached actors would properly generate the on hit event (but they would still properly do blocking collisions in the viewport). However, if I used a TArray instead to group them, they all generated the on hit event as expected.
Furthermore, I found out that you have to set the optional bSweep=true when setting the actor’s location otherwise it won’t generate the on hit event. This one probably seems obvious to people with more experiences though.
The final interesting thing I discovered is that collision boxes are sticky (At least for ACharacter, I haven’t tested with APawn of AActor). If the collisision box moves and the character is on top of it, then the character sticks to it and moves too without generating collision events. The only work around I found was to have the mesh and collision box move separately, ie, the collision box stays still while the mesh moves.
I’m still trying to figure out if there’s any implicit enforcement for child components. Like if a capsule component is doing block-world-dynamic collisions, and it has a child mesh component that’s doing overlap collisions. Does the parent component override the child components setting. Do they both keep their individual collisions settings. I don’t know yet.
Anyway, I really appreciate the in depth response Dan, Thank you!