Simple Turret Behavior
Hi everyone !
I am currently doing some turrets, with a simple behavior (if a target enter the range, the turret fires), and I am encountering a problem. I had trouble setting up a function that can repeat as long as the target is in range, and for the moment I am using a gate. The turret can have multiple barrels, so I'm using a forloop with an array of all the socket names corresponding to the barrels. If I put a printstring after this forloop, I can see it works perfectly great, the prints are display in the number of my array, and at the fire rate I want. However, if I plug a spawn actor to spawn my projectile, the function works one times, and does not reapeat anymore. Is this a bug with the spawn actor ? I know for sure it's not a limitation, because i tried bypassing my forloop in order to spawn only one projectile, and it stop after the first fire.
Here is the full blueprint for the turret : https://blueprintue.com/blueprint/nuu2rrkz/
Thanks for any help or insight that could come, Have a nice day !
asked Feb 07 '19 at 03:09 PM in Blueprint Scripting
I guess I know.
When your projectile spawns, it overlaps the sphere. And since it doesn't have the "ennemy" tag, the gate closes.
Change the collision presets for the sphere not to react to the projectile.
Edit: I think you should leave the False empty. There's really no need to close the gate On Begin Overlap like ever.
Follow this question
Once you sign in you will be able to subscribe for any updates here