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"

Spawn a number of Objects in a straight line

alt text

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. alt text

Product Version: UE 4.18
more ▼

asked Jan 23 '18 at 05:31 PM in Blueprint Scripting

avatar image

39 1 4 6

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

1 answer: sort voted first

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.

more ▼

answered Jan 23 '18 at 06:13 PM

avatar image

6k 163 130 305

avatar image TheSteelJC Jan 24 '18 at 04:46 PM

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?

avatar image xlar8or Jan 25 '18 at 11:47 AM

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

blocks-bp.zip (13.2 kB)
(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