i have blueprint “bowzer” who when is destroyed then spawns blueprint “wand” when blueprint “wand” is overlapped by the “first person character” pawn i want blueprint “floor” to be destroyed. the problem is that because blueprint “wand” is not in the scene but rather waiting to be spawned, it wont let me use the eyedropper to select “floor” so i cant destroy “floor”?
im fairly inexperienced so ive seen a few possible one word answers like “you need to cast to object”. but thats not really enough information for a noob like me to work it out.
you are creating an actor at runtime (while the game is playing), therefore you cannot point it to a reference of another actor at design time (when game is not running).
So that is the problem you are facing. How to give reference to one actor to another actor at runtime?
Sadly, there is a bazillion ways to do this, and there are simple ways, and there are complicated ways, and the way that you reference actors can have big performance implications.
However, you are a beginner so there is no good reason to muddle your mind with performance considerations that hinge on subjects you don’t yet know about.
So, with that in mind, a very simple way that you can get reference to the floor is to give it a tag. Select the floor and type “tag” in the details panel. Add to the array a tag, like “floor.”
In the wand or whoever needs to know about the floor, use node Get Actors with Tag, and use that same tag to search for. This will return any actors with that tag. If you know that there is only one with the tag, just use Get node from the returned array and leave it at 0. 0 is the first index of the array.
If you want to learn deeper about ways for blueprints to communicate (which is important!) seek out tutorials on the subject “blueprint communication”. In particular I think that Event Dispatchers are probably talked about the least but I think can make for most simple, decoupled, and extendable blueprint architecture you can make.
wow thankyou so much! ive spent so much time on this trying so many complicated things like blueprint instances and storing references in the level bluerint etc. Id already tried tags and already had “floor” as a tag! i guess i just didnt know how to link the get actors of tag to the destroy actor function properly and thats why it didnt work.