How to reset an triggered event after end overlapping inside a box collision?

Unreal Engine version 4.25.4

Hello there!

Does anyone have an idea on which nodes i need to use inside a blueprint to reset an triggered event, triggered through a box collision when something overlaps with it?

What i did so far: I managed to trigger the box collision to turn off the collision of an destructible mesh, after something (like a projectile) begins to overlap with it.

What my issue is: I want to reset the turned off collision of the destructible mesh, to be turned on again, after the overlapping ends. But i don´t know the right nodes to do this.

For clarification: [First half] A projectile (or whatever) starts to overlap with the box collision inside the blueprint. The collision of the destructible mesh (also inside the blueprint) get´s turned off (well, changed to no collision). [Second half] After the overlapping ends (the projectile is not touching the box collision anymore), the collision of the destructible mesh should be turned on again.

I think this is actually very simple to do, but because i don´t know the right nodes and can´t find any information to this or something similar, it is harder than it needs to be. I am a beginner to blueprint “coding” and haven´t really got the hang out of it yet. So any help would be very helpfull. Thank you.

What’s your overall intent? What’s the reasoning behind disabling the collision?

For a “temp” work around you can add another “thin” collision. On overlap of destructible mesh collision (DMC), disable dmc, enable thin collision. On overlap of thin, disable thin, enable dmc.

This is an absolutely bs approach btw and it should never be part of a production build.

My problem is that the destructible mesh has a hitbox which prevents me to go/ shoot through the doorframe without needing to break some chunks off it first to let me pass through. So my intend is to place inside an blueprint a box collision where the doorframe is and let it turn off the hitbox of the destructible mesh when something starts to overlap with it. This is all i managed to do, but now the hitbox keeps being turned off even after the overlapping with the box collision is over. What nodes do i need to turn the hitbox back on when nothing is overlapping with the collision box?

“When nothing is overlapping” does there really need to be any changes made?
No, probably not.

It’s the next overlap that you need to figure out what to do (ei: always turn the collision on first, and leave the code you have the exact same).

If the issue is the player, then just set up the interface on the player to turn on the collision when he walks in.
(Possible hug if inside the collision area and you shoot, so plan for that).

If you “dumb” down exactly what you need there is probably a better logically sound sequence of events.

And, to answer your other question.
There’s an “on end overlap” event you can use.

On begin overlap, store the overlapped actor.

On end overlap, if the actor matches the stored one, do what you need to.

The problem with this and projectiles is “everything”. Because physics speed even with substepping the system is rather prone to bugs.
Using a ray trace is probably best, but obviously there is no “on end overlap” there. You could use a timer with a variable length based on Distance + projectile speed math…

Ahh the interactable destructible door.

One approach is to take the mesh and break it up into destructible pieces (fragments). Create an Actor class (e.g. Door). Add a box collision component that represents the door as a whole. Have it ignore projectiles and anything else that can damage the door pieces. Add sm components as child of box collision. Assemble the fragments to form the whole door. Each fragment having it’s own collision.

Open/close interaction will utilize the box collision. It moves the fragments move with it. Projectiles will dmg door fragments. On enough dmg hide & disable or destroy the sm component fragment, spawn fx etc.

When all fragments are destroyed, disable the box collision, or destroy the door actor (server side).

If you want dmg + penetration you’ll need to spawn a new projectile at hit or use overlap detection on the door.

Would be nice if chaos worked as advertised on this one XD

1 Like

yup!

I fixed the problem. I just fractured all the modules in blender and imported them as FBX chunks to the destructible mesh.