Hitbox priority implementation

Is it possible to implement a system where there is a collision in the same frame the collision functions (beginoverlap for example) are called in a pre-defined order (aka priority)?

For example:


In this collision 1 would be done first and then 2 and then three.

You could script it and process everything with a 1 frame delay. You have 3 booleans one for each collission. When an event occurs you simply set the corresponding boolean to true, afterwards in the tick function you execute the appropriate response to the collisions in the order you desire. if you would need to store information of the collissions as well you could do that of course. Note: this solution assumes that the collissions take place in the same frame, if this is not the case it is a little bit harder harder, but you could delay the response to a collision for some frames until you are sure the other 2 collisions didn’t occur for example this could be done using the deltatime per frame and a small interval in time you use as validation that none of the other collisions occured.

I’m using a custom component that acts as a hitbox bubble and has a capsule component and information like knockback or damage and the priority number, one approach I was thinking is when an overlap ocurrs to check for any other overlapping actors of the hitbox bubble type and if one outprioritizes the current one it is ignored.

What I’m wondering is, if I try to check for an overlap before an overlap event for that overlap has been fired, will it be detected?

I have a hitbox actor that checks the priority level on overlap. If one hitbox has priority of 3 then it has priority over the opposing hitbox with a priority of 1. If the priority is the same they call a clash function. I also have the priority variable exposed on spawn so when I spawn the hitboxes I can set the priority as it spawns.