Spawn a number of Objects in a straight line


In the picture above you see a Red which indicates the straight line, the black dots where I want to spawn the objects of the same type, and the light brown circle which is the player. The point is I want to spawn 7 rocks in a straight line? Could you help me with this?

Another Image to show what I mean. As you can see in the image below taken from dota 2, earthshaker casted his first skill which is called Fissure, which spawned golden metals in front of him in a straight line.


Hey there, you can create dynamic static meshes by using the Add Static Mesh Component function, you just need to offset it based on the width of the rocks and multiplied by the number of rocks you already placed multiplied by the forward vector, so:

Position = RockWidth * CurrentRockNumber * ForwardVector

After you place one rock, you increment the CurrentRockNumber so the next one will offset accordingly.

Thanks for the answer man. But, can you make the blueprint for me, as I am having a hard time to do it in blueprints?

I can’t do all the code for you, but i’ve attached a basic blueprint that does what you text Just put it on the content folder of your project. You might need to call the Build function on begin play.