I have solved the original problem on my own and understand what happened, but I’m posting the situation here in hopes of (1) sharing my solution to benefit others and (2) enhancing my own knowledge by clarifying a confusing paragraph in the UE documentation. My project is in UE 5.0.3 (we haven’t upgraded this one yet.)
Situation and Original Problem
I made a Dynamic Mesh Actor subclass (Blueprint this time, but the discussion would apply to C++ as well) that presents a simple box primitive with two gizmo handles for the designer to place opposite corners of the box. I’m creating a tool for our designers that lets them define a “soft boundary” for players. The designer sizes the Blueprint object to define the soft boundary, and my Blueprint automatically creates an invisible “hard boundary” wall that follows the longer (of X and Y) axis and uses ordinary blocking collision to stop the player Pawn. There is an OnBeginOverlap/OnEndOverlap event pair on the soft boundary box to provide a gentle HUD cue that the player is approaching the edge of the map.
The obvious settings were enabled on both the player Pawn:
- Generate Overlap Events: ON
- Collision Presets (Pawn’s collision capsule): Pawn
- Collision Presets (Dynamic Mesh Actor): Trigger
- Collision enabled on both Actors
- The BP function that creates/updates the “soft boundary” box calls the API functions to ensure the above collision settings after rebuilding the mesh.
- For initial testing, the inner “hard boundary” was omitted to avoid interference.
- The Dynamic Mesh Actor BP calls Update Collision and overrides deferral.
I snagged the overlap events on the Dynamic Mesh Actor (the trigger box) and on the player Pawn (which uses a custom Blueprint based on the standard third person. character).
When I tested, the Pawn’s overlap events fired – but not reliably – and the Dynamic Mesh Actor’s overlap events did not fire at all. The Pawn’s events also fired (as expected) when its capsule collider slightly penetrated a step-up Static Mesh Actor. (For testing, I displayed a debug string even if the other Actor wasn’t of interest.)
Solution to Original Problem
The solution was to set the Dynamic Mesh Actor collision to “Use Complex Collision as Simple”. It appears that the Dynamic Mesh needs to use its complex collision mode even if its shape happens to match a simple collision primitive – at least, that is the default situation.
Once I made that change, everything works perfectly, including the inner “hard boundary” with its blocking collision.
Follow-Up Questions and Discussion
Along the way to solving this problem, I encountered the following text in the official UE documentation (Trigger Volume Actors in Unreal Engine | Unreal Engine 5.1 Documentation):
Triggering Events
Triggers are used to activate events placed inside of the Level Blueprint.
My first question is whether that statement is correct. Once I fixed the collision mode, the overlap events are working just fine in several Blueprints that are not the Level Blueprint. In fact, the Level Blueprint is empty for this level. I did verify that the overlap events also work in a trivial Level Blueprint (no surprise…), but this sentence seems to me to imply they would not be intended for use elsewhere. Can someone clarify the intent of this statement in the docs?
Secondly, short of procedurally creating a TriggerBox Actor matched to the current size of the Dynamic Mesh, or copying the Dynamic Mesh to a Static Mesh, is there a procedural way to add a simple collision primitive to the Dynamic Mesh? If so, is it worth doing that as a performance optimization, or is a “complex” collision reasonably efficient on a convex mesh with only 12 triangles?
Third, in my search for a solution I encountered a forum post stating that Dynamic Mesh overlap events fire based on an implied “skin” of about 100 cm thickness, and that on large Dynamic Mesh Actors the center is treated as being “outside”. Is that correct for UE 5.1.1, and if so, does anyone know if it’s intentional?
I appreciate any comments and suggestions. What I have is working, but I don’t want to develop bad coding habits, so please tell me if I solved this in the wrong way.
As a final note, I realize I could have attached a custom BP component to a standard TriggerBox object, or vice-versa. The reason I didn’t do that is that I wanted the designers to be able to drag corner gizmos and not have to set box sizes in the Details panel, and because I wanted to apply a custom translucent Material that’s easier to see in the editor and (during testing) at runtime. If there’s a better way to accomplish this, I’m open to rethinking my approach.