Destroy an actor from Widget clicked button

I’m trying to destroy an actor after clicking on a widget button option but I don’t know what should be connected to
“object” in the cast of the blueprint.

the actor your looking to destroy should be in the object pin. basically you need to have a reference to the instance of the actor in the level. so for example lets say you have 3 trees in your level (tree1, tree2, tree3), you would need to tell the destroy actor node which tree you want to destroy.

im guessing that you dont really understand casting. think of casts like a way to identify an actors class, the object in is the actor to be identified.

oh also your calling your destroy actor on tick so as soon as your widget is created the actor will be destroyed. its not going to work as expected i imagine.

So how would you make a reference to the actual tree you want to destroy from within the widget blueprint?

You need a reference to the specific instance of BP_Eggs you want to destroy. Check out video #1 on casting if you need to brush up on that and video #25 for creating references. One of those methods should work for you.

Also, as ThompsonN13 said, you need to fix that tick issue…otherwise this will be instantly destroyed.

Thank you buddy :slight_smile: Awesome guides for a newbie like myself. Exactly what i needed.

No problem, happy to help.