Multiple player collision zones: is there a better alternative to casting?

I’m currently working on a Blueprint right now that requires additional player collision input beyond the standard capsule. To do this, I created three collision spheres as children of the original capsule which I need to use to trigger my Blueprint (“BP_TraceFull”) upon overlap.

The problem is that each of these collision spheres has to be cast to the Blueprint, which you can see in this screenshot.

This causes an issue because I’m going to have multiple types of Blueprints which need to be cast to (BP_TraceFull1, _TraceFull2, etc.), each able to interact with the three collision zones, and each Blueprint will be placed in the world multipel times. My understanding is that casting is very intensive and I’d prefer a cleaner way for the Blueprint to interact with my player collision if possible.

Some of my alternative ideas were to create a modular BP_TraceFull that would cover the functionality of the other Blueprint types, or use one collision zone and simulate other zones using vector offsets, but that doesn’t achieve exactly what I need it to.

Is there a better alternative to casting that will allow my player Blueprint to still communicate the overlap information of each zone to each of my Blueprints?

Thanks in advance!

Blueprint Interface


You’ll need custom collision obj channels for this.
Project settings → Collision

Create one and name it “TraceFull” for example. Set it to ignore by default.

Config your character collisions components (head, body, feet) to use it.
Object Type: TraceFull
Ignore All, Overlap Tracefull

Apply the same setup to your BP_Tracefull collision components.

Now only these two can interact with each other. Meaning only the BP_TraceFull, TraceFull2 will trigger an overlap with your characters head, body, feet collision comps.


Create a Blueprint Interface.
Rename the default function to “TraceBeginOverlap”.
Add an input… “Component”, Type: Name
Duplicate the function (copy/paste)… Rename to “TraceEndOverlap”
Compile, save, close


In your character class setup the Begin/End overlap events for each component.

Create a Function… name it “ComponentBeginOverlap”.
Add two inputs. Actor, type: Actor obj Ref … Component, type: Name

Duplicate the function, rename “ComponentEndOverlap”, update the message to TraceEndOverlap.


Pipe up the functions to the begin/end overlap events and configure the component field.


Open BP_TraceFull
Make sure you update the collision settings as described above.

Next, Class Settings → Interfaces ->Implemented Interface ( ADD BPI_TraceFull )
Compile & Save!


In the “My Blueprint” Panel locate the Interfaces section.

image

Right click on each of the events and Implement them.

image

You should now have two Events in the Event Graph.

Create a “Switch on Name” node.

Configure as shown…


From here you just code up what you want to happen for each Begin/End Overlap.

3 Likes

You are a saint for writing that up and adding pictures. I’ll give it a shot. Thanks a ton!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.