Shooting Projectiles all around an enemy

How would I make it so when I call this custom event, the enemy shoots projectiles all around it in like 4 or 8 directions surrounding it? Like it’s shooting a circle of projectiles around itself.

Thanks for any advice.

Many ways.

Here is a simple example.

You can place in your BP, the locations and the directions from where your projectiles will be spawned. In this example, I placed arrows components:

Then it’s just a question of spawning the projectiles from the transform of those arrows:

1 Like

Thanks, I’ll try this later on and let you know how it goes.

This is probably a dumb question but i’m not exactly with Loops and Arrays but when I try to add “Get World Transform” from the Array Element on the loop it doesn’t show up, could you explain why? Thanks.

2 possibilities:

  1. Did you selcted ed “Arrow Component” in “Get Components By Class”?
  2. Did you connected the “Get Components By Class” to the “For Each Loop”?

Yeah I have, my one looks the exact same as the one you sent in the image other then not having the world transform, the components by class is connected to the for each loop.

Can you share a screenshot?

last resort: uncheck the “context sensitive” in the search and check if it compiles.

Im able to get the “Get World Transform” from the Spawn Actor node but it can’t connect to the array element.

can’t you connect array element to target?

place the mouse over array element and check the comentary. Is it something like this:

img_5

Even if you disable the context, can’t you get a “Get World Transform” from the array element?

If I disable the context, it lets me get “Get World Transform” but the node doesn’t actually connect to the array element

create another actor, and replicate the code. Don’t copy/paste. Just place a new event, the get compontents (arrow), the loop, … Check if it works there.

Tried this just now, same problem.

Try refreshing the For Each Loop node by right clicking it and selecting Refresh Nodes

Or you have to specify the Class first in the Get Components By Class and then connect it to the For Each Loop.

If you connect first and then select the class, the For Each Loop would still have the Array Element pin as an Actor Component instead of Arrow Component. Actor Components don’t have a transform.

That was it, it works fine now thank you.