how to destoy the shield after enemy is destroyed

ive tried to store shiled should be destroyed in a varible and set it to true after destroy actor in enemy blueprint and used a branch in the shield blueprint to check it if true that destroy the shiled but it didnt work out the shield stayed there

Your post doesn’t make much sense. Could you rewrite the text or add some images to showcase what you are trying to do?

You could run a cast to the shield from the enemy and with the reference destroy it before the enemy is destroyed.

the proplem is they both not valid as for the screenshots there they are here


You have to do it before you run the destroy function. Anything after destroy function will not run as it has been destroyed. Think of it as layers or a hierarchical structure.

If I have some information and you destroy me, I can do anything for you after that.

The only way to do it while calling the destroy function is to add another funcion override for the onDestroyed event.
And that only works when you explicity call the destruction like you are doing.

Ofc you have to make sure the object being destroyed is the correct one.

Order of operations and all of that.
Cant destroy self and then expect additional code to be run after its destroyed…

thank you and what after ondestroyed i tried destroy actor after that and reference to the shield but that didnt work can you show me a blueprint of this plz

Honestly, its probably a c++ only override?
Not sure, depends on engine version too.

If you are able to find the override and create your own function - what is the problem exactly? Is it able to do a simple task like “print string”?

the proplem is i really dont know how to destroy actor after enemy on destroyed i tried to make it a value and reference to the actor destroy actor didnt work unfortunatly btw its a blueprint on destroyed function this can be done by blueprints but i dont know how to do that exactly

Really, I’d use a bluprint interface call to get the object to destroy along.

Should be clean and efficient, also reusable…

yea how

Look up how to use interface calls.

i tried ive seen alot of tutorials but not specfically on that

You create the interface, implement it on the shield, and call destroy self from it.

The character then sends the interface call, and that’s all there is to it…

You can expand on funcionality of it as you learn more about the engine;
For instance you can pass the shield object of the character to make sure only the right actor is deleted from the call… if self == actor then destroy self…

can you show me a blueprint plz

That I cannot do…

ok