Does "Destroy Actor" function destroy actor's Blueprint as well?

I’ve been following [this simple tutorial][1], but I wanted to try and add some extra functionality to pickup. Instead of permanently changing player’s run speed I wanted to put it on a timer so that it would only last a few seconds. I figured that way I have it set up (below) makes most sense.

Unfortunately it seems that delay function is never executed, even if I set up destroy actor and delay in a sequence. However, delay does work if I get it to run before destroy actor. What this tells me is that destroy actor also destroys not just actor in-game but its blueprint as well (which is what I’m working in).

Is my assumption correct? And if it is, why would destroy actor have an execution pin coming out of it? Also more importantly, how do I get this to work? Call into another blueprint before this one is destroyed?

No, Blueprint is just a… Blueprint. It’s a Child of Class that you pick when you create it and you can place as many as you want in your Scene.

IF you place a BP in your scene, it is an actor. Basicly everything in your Scene is an actor. So if you “Detroy Actor”, you destroy Copy that you are using inside your scene/game. Blueprint stays intact. Imagine putting down 2 copies of your BP. If you destroy one, other stays alive till you also destroy it.

problem with your setup here is, that a destroyed actor can’t do anything, because simply it’s gone. You need to place Destroy actor at end of function. So that you do everything you want with that actor and after that, you destroy it. Then it’s gone until you spawn a new version of that Class/Blueprint.

So you confirmed my suspicions, but problem is that I want to have something happen after actor is destroyed. In particular, I want to change player’s walk speed after object is already destroyed. Is there a simple way to call into another blueprint so I can have effect happen at right time?

I guess yes, but i’m not that skilled in blueprint communication. Better search AnswerHub for “Blueprint communication” or wait till some helps me out here :smiley: I would need to study this some time.

You could make a function inside your CharacterController BP that changes Movementspeed (+ delay etc.) and just call function from PickUp BP (i assume picture above is from PickUp BP). After you called function, you can destroy PickUp.

There is an Event Destroyed node that you can place in a Blueprint. When an instance of that Blueprint is destroyed, it executes that Event. If you have multiple things you want to accomplish after an Actor is destroyed, it’s best to put it in a Function and call that function from Event Destroyed node.

Hope that helps!

Alright so just in case anyone reads this and is wondering how to make it work, it was actually pretty simple. All I did was add a custom event to my character blueprint’s event graph. Yes event graph because for whatever goofy reason you will get error “delay contains a latent call which cannot exist outside of event graph” if you attempt to put a delay function inside of another function.

So instead I discovered custom events, and custom events can be called from another blueprint, which is what I’m doing just before I destroy pickup actor. This solves problem because my character blueprint instance is not destroyed, only pickup, so chain of execution can carry on.

Here is my pickup blueprint.

And here is custom event inside of my character event graph.

Bonus: Instead of hard coding max movement speed back down to default you can simply grab default “Max Custom Movement Speed” variable from Character Movement component and use that. This way if you change default movement speed you won’t have to change it in two places (or you might forget!).

I looked into this communication stuff a bit and I determined that what you suggest is impossible, but I originally tried that same technique. Check out answer I gave if you want to read about it.

Hey TacoShank,

events inside Functions occur immediately, so Delays inside of Functions have caused all sorts of problems (thus error message). Using them inside a Custom Event, as you have discovered, should be fine in cases like this. Again, there is an Event Destroyed node available that might make this a lot simpler, but I’m glad you got it working!

Actually, it looks like you have it set up same way I would do it. Event Destroyed should really only deal with Actor itself, and it makes more sense in this case to perform these actions on Character since you’re working with it’s CharacterMovement components.

If you wanted to, though, you could cast to Character’s MovementChanged event on Event Destroyed. It would work essentially same, except that it would wait until pickup Actor is destroyed in level. way you have it set up here is cleaner, though, and I would stick with that.

Event Destroyed would be useful in cases where you wanted an emitter to be spawned only when Actor is destroyed. More often, I use it in my Characters to trigger respawn.

Thanks for clarification on that!

Also I did try messing around with Event Destroyed node for awhile but I was using it inside of pickup BP at time and also trying to use data from that BP. It seems that data was also getting destroyed even if I stored it in a custom variable which is why I abandoned that route. Specifically I was having trouble getting access again to character movement component.

I don’t see a good way of getting character component back, but if you have any ideas I would like to know because I agree that solution would be simpler.

Thanks for help !