Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 !

Product Version: UE 4.21
more ▼

asked Feb 07 '19 at 03:09 PM in Blueprint Scripting

avatar image

62 2 4 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Feb 07 '19 at 03:20 PM

avatar image

1.8k 12 7 8

avatar image tbeaugelin Feb 07 '19 at 03:52 PM

Yup, that was it. Stupid mistake on my side. Thanks for the quick answer :) I followed you sugestion, and left Fasle empty. I did it in order to be sure that the turret would not start firing when anything else than an ennemy entered the zone, it might be stupid ^^'

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question