Download

Having Destroy Actor issues

I am having trouble destroying an actor that I casted since I can’t figure out what the object is supposed to be. Here is the image of what I tried to do so far.

There needs to be a reference to the object you’re trying to destroy. If the object was spawned it in to the world, then you need to save that reference somewhere when it was spawned. You can access it later to destroy it. Is your object called Tab0? If the actor was placed in the world through the level editor, then you need to grab a reference to that run time. The easiest way would be a GetAllActorsOfClass.

Basically, you need to point to the actor you actually want to destroy.

Check out video #1 on casting and #25 on creating references in this playlist. I think it will help you understand what the issue is.