Destroy Actor from another blueprint

Hi everyone, Ive got two separate blueprints, one for a door and one for my pickups. The pickup blueprint keeps track of how many pickups the player as collected. Now I want it so that when the player reaches a certain number of pickups the door gets destroyed. Ive tried the following nodes, but the door is not getting destroyed, but the string is getting printed.

Thanks in advance for any help.

did you make Shure your actor is valid also you could try implementing a function within the actor that might help. other than that i d need more information

1 Like

Hi @Gilsa, I think I can help.
Make sure Prota Ref is set. I recommend you exposing this variable on spawn so you can set which door specifically you want to destroy.
Hope this helps. :+1:

1 Like

OK, I tried wath you said but the door is still not getting destroyed, heres what I did in case ive made any mistake.


Also to make sure I did it correctly, in my porta ref I selected the porta blueprint in the variable type and checked the expose on spawn, thats the only things I modified in the reference.

How can I make sure my actor is valid? And yeah, Ive already tried using a function that simply destroy the actor, but the actor is still not getting destroyed. Ill send you the full BP. Also when I run and close the game I get a message saying "Blueprint Runtime Error: “Accessed None trying to read property PortaRef”. Node: Destroy Actor Graph: EventGraph Function: Execute Ubergraph BP Pickup Blueprint: BP_Pickup " , Dont know whats causing it tough.

Ok,Ive got it solved, instead of using a variable for the reference, I just used the get all actors of class, and it works just has I wanted.

You set the Porta Ref to nothing, and then you try to destroy it.
That’s not going to work.

What sets up the Porta Ref to point to the appropriate door in the first place?

1 Like

How to check if something is valid

there are 2 main mathods i know of

1 Do an is valid check just click and drag from the pin youd like to know is valid
Then release Look for is valid It should show up under the utilities in 2 forms one pure
and the other as a branch

2 Take your get variable and right click then look for “convert to validated get” select that and your all good

also listen to jwatte hes got your initial problem sussed out

You need to set the ‘porta ref’ variable with an input.

in the image you posted, the ‘Set’ node has no input, so it sets the variable to ‘Null’ (or wipes it away to null if it was set somewhere else)…after that, the input into ‘Destroy Actor’ is null.

you need to connect a valid ref into input into the Set node.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.