How can I dynamically toggle collision on an object in blueprint?

I’m trying to toggle the collision on an object in my class blueprint based on a projectile hitting the object. What I want to have happen is the box object starts with collision on, I shoot a projectile at the box which toggles off its collision, but when I shoot a projectile at the box again, I want the collision to toggle back on and so and so forth.

What’s happening at the moment is, collision toggles off after the first projectile collides with the object. Additional projectiles do not toggle the object back on (I’m assuming because collision has been disabled so it is no longer detected).

Here’s how I currently have it set up:

I can see why this wouldn’t work (since collision is toggled off), but I can’t figure out a better solution to this problem. Any assistance is appreciated.

You can set how the box reacts to specific types of objects.

For instance: If you want the box to ignore collision with the Player (which is a Pawn) you can ‘Set Collision Response to Channel’ ‘Pawn’ to ignore when hit, instead of disabling collision altogether.

Here is an example of the Blueprint nodes:

Note: You have to plug in a Component to the ‘Target’ pin, not an Actor (like the 'Set Actor Enable Collision).

I hope that helps. :slight_smile:

Thank you so much. That solved my problem!

Is there a reason this node could not work? Because if I use this node, nothing happens, not even when I plug it directly into the tick. It does not change the collision response to that channel.