Respawn Actor in New Location After Destroyed

I can’t seem to figure out how to respawn an actor after it is destroyed. I have targets (cubes) set up that you shoot and you get points and they destroy. I want those cube to be able to spawn in a new, random location after they are shot. I can currently get them to respawn at a specific location, as set up in the screenshot. But how can I set it up either to a random point, or at least choose from a set of targets in an array?

Also, once I get the actor to respawn as it is currently set up, the actor can be shot, but it won’t destroy again or give any points. How do I set up the respawn to react the same way to being shot as the initial actors in the scene?

Hi DMHokie,

All you should need to do is add a “Random Float in Range” to each component of the location vector that you want to move the actor on. So, if you want to spawn them in the X,Y but not change the Z, you would make vector and plug Random Float in Range (min,max) into the X and Y but not Z.

Cool, that worked. What would be the best way to set them to spawn and random targets that I have placed around the scene? Say have 20 targets placed, and the new thing will spawn at a random one?

for that , you can create a new actor , call it spawner, then put some of them in your scene, and use a “get all actor of class” node to collect them in an array, and for spawn, just randomize the read index of your array, and it should work.
i used this method on this project here :

fell free to watch it.

expose’s answer is definitely similar to how I would approach this question. I’d highly recommend giving his solution a try!

Thanks! That is perfect for what I need. The last question on this though. When I hit a target and it respawns, if I hit it again, it will continue to respawn, but it won’t continue to add a score as it does like the first time it is hit. I can’t figure out how to make it continue adding a point to the score when they have respawned and got hit again. Do you have any ideas on that?

For the value you need to have integer + integer
For A put the value of score and for B the amount you need to add.