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

**URL:** <https://forums.unrealengine.com/t/how-to-trigger-an-event-if-all-components-of-an-actor-class-are-destroyed/1841267>\
**Category:** Blueprint\
**Tags:** actor-component, custom-event, unreal-engine, Event, Components, Blueprint\
**Created:** [May 5, 2024, 1:46pm UTC](https://forums.unrealengine.com/t/how-to-trigger-an-event-if-all-components-of-an-actor-class-are-destroyed/1841267 "2024-05-05T13:46:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhaolee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rhaolee/32/933531_2.png) [@rhaolee](https://forums.unrealengine.com/u/rhaolee)\
**Post date:** [May 5, 2024, 1:46pm UTC](https://forums.unrealengine.com/t/how-to-trigger-an-event-if-all-components-of-an-actor-class-are-destroyed/1841267/1 "2024-05-05T13:46:29Z")

</div>

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.

 ![Custom event if all components of type from all actors of class are equal to the amount of actors present](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/e/1/ae115389974d93450862cd928c284cd25d79c858.png)
