So, i’ve been trying for on and off for a whole day to try to get this enemy spawner to work. What’s supposed to happen is I kill the first enemy, and a few more spawn in than last time. The problem is… well i dont know! im very new to unreal and coding in general, so ive been following tutorials on this exact thing, and nothing i do will make it function.
To go through it rq, in the game mode i made this code in the game mode im using
Yes, i was sure to have the game mode im coding in selected in the world settings There are no errors as well, everything complies as normal. My only thought is maybe the destroy actor node is killing it too fast? but its at the end of the code so idk why that would be happening
Man I am finding it a lot easier to use interfaces than Event Dispatchers when I want to transmit a pulse to another BP. Make a blueprint interface, add it to both the bp’s you want to use. Open the interface, add “spawn enemies” as a function, save and close. In the transmitting bp, search for spawn enemies message. Place that and make sure you put a reference to where you are trying to send the message. Then in the receiving bp, in your interface options and stuff, find “spawn enemies” and choose to implement it. Now you will have a red firing event that can be used where you want it and when you want it!
The use case for dispatchers ( many ) and interfaces ( one-one ) is totally different.
You could actually do it with no communication whatsoever. Just code the game mode to periodically see how many baddies there are. Spawn new ones when there’s not enough.
Hey all, thanks so much for the support lol. I just got back from work and life stuff right now so im gonna take another crack at it. Im thinking about just making it with no communication between BPs- that’ll be a little but messier but worth it at this point lol.
Again, im super new to UE so ima try what usa said if i cant get it to work. Wish me luck fellas
(P.S. Currently watching a vid on blueprint interfaces just to see what the heck they even are lol)
The problem was in the enemy BP! I did the print string trick and found out that way. The solution was an array! After taking a quick break, i realized the original bp wasnt communicating how many enemies were actually left, so i messed around with the array and everything went smoothly from there! Thank yall again for the help