Download

How to make a Destructible AIspawner

Im fairly new to UE4 and have been having trouble getting a hang of BP scripting, however once I figure things out I really love it. The main thing im having a problem with, is just lacking the know how to go about doing the things I want to do. Please forgive me for that.

I am trying to make a prop, say a Orc hut spawn AI nonstop till the player breaks it, or the orc hut’s health reaches zero and then have it break and fall apart. In the pass ive managed to make a spawner from an orc hut but it would keep spawning even after breaking the hut. I scraped that and decided to start from scratch. Ive been trying for a while and have been very timid to ask for help on the forums. I hope I explained this enough in a way that makes sense.

I will try to explain what I think I would do. Before the spawn ai node I would use a branch. Then hook up true to spawn actor(ai). I would make a variable(bool), i would call it KeepSpawning? and would set it to true by default. Then I would get huts health variable(float) and compare it to float. If health is zero, it would set KeepSpawning to false. Now I would drag a getter of KeepSpawning and hook it up to condition pin in branch node.

Im not at my computer and im still new to this businesses, so dont be surprised if it doesn’t work :). But this is how I would try it. Hope I helped!

Did destroy actor node not work? Normally thats should work or I missed something.

I remember I had a point light in a projectile once. The projectile had destroy actor on hit setup. But when I tested it, the projectile would be destroyed, but the point light would stay stuck to the object it hit. So there was some extra setup needed.

Pabooklas, is the pointlight part of the BP (as in a component), or spawned by the blueprint? If the latter, I can see why the pointlight remains in the level.

Anyway, maybe showing your network would help things.

It was a component of the BP.

Oh, my bad then.