How To Trigger An Event If All Components Of An Actor Class Are Destroyed

rhaolee
Sun, 05 May 2024 13:46:28 +0000
Blueprint

I just wanted to share this as I couldn’t find much info while I was trying to figure it out. I’m still new to unreal but I hope this helps if anyone is looking for something similar, if there’s a more efficient way to do this or if there’s any issues with the way I’m doing it please let me know!

I have ceiling light actors with a line trace interface event that destroys the point light component, I was wanting to trigger an event when all of these point light components are destroyed.

The way I’ve done this is to make an integer variable in the actor to track the number of components destroyed, then I used a for each loop to increment this amount everytime one is destroyed and then check if the amount of them destroyed is equal to the amount of light actors present in the level.

1 post - 1 participant