# Curve a series of objects

**URL:** <https://forums.unrealengine.com/t/curve-a-series-of-objects/471428>\
**Category:** Community & Industry Discussion\
**Tags:** unreal-engine, curve, question\
**Created:** [September 16, 2020, 12:03pm UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428 "2020-09-16T12:03:31Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 16, 2020, 12:03pm UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/1 "2020-09-16T12:03:31Z")

</div>

Hi all

I have a line of objects (screenshot attached).

Instead of the objects forming in a line, I want them to curve upward. I have been searching but I can’t seem to find an answer. Is there an efficient way to do this in Unreal, or is something that should be done in Blender?

If any clarification is needed on this question, please let me know.

Thank you in advance for the assistance.

Cheers  
Matt

 ![313815-line.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/0/0e01874c2b6dca5e3ab2c6e2b60b83dec17133f1.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 16, 2020, 12:34pm UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/2 "2020-09-16T12:34:40Z")

</div>

You could use a spline for distribution.

 ![313803-screenshot-2020-09-16-133135.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/f/4cf588e9b694834be45cf55a29ae7c5755f910c4.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/1/5f1c7387c06a68021b021f6d155c543273410c8e.gif)](https://gyazo.com/405594bd6025abdbb8d0836b3821661c)

If you needed the arrows to bend & twist along the curvature, you’d need to ensure each arrow mesh has enough geometry to deform and treat it as spline mesh component.

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 17, 2020, 7:46am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/3 "2020-09-17T07:46:01Z")

</div>

Hi, thanks for this! I’ve mostly put this blueprint and I have some questions, if that’s okay:

1. How did you ‘convert’ the component to a float (I’m referring to what is in the screenshot)? I can’t seem to figure out how to do this; and
2. How do you ensure that the Spline references the arrow shape? I currently have an Arrow Actor Blueprint, which sets the material of the Arrow mesh and incorporates a bouncing animation. Will my Spline need to reference a mesh, rather than an Actor Blueprint?

Please let me know if clarification is needed on these questions. Thanks again for the help!

Cheers Matt

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 17, 2020, 9:14am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/4 "2020-09-17T09:14:26Z")

</div>

> How did you ‘convert’ the component to  
> a float (I’m referring to what is in  
> the screenshot)?

Not a conversion, it’s one of the Spline Component’s properties. No matter the length of the spline (physical distance), the duration can be normalised to a set value: 1 by default. A spline that is 5456 uus long can still have a duration of 1 - makes it easier to conceptualise percentage ratios.

 ![313988-spline.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/2/a724fd94252d6a556b271e344d21a5f069879c1b.jpeg)

Drag the Spline Component to the graph, drag a wire from its reference and then search - you’ll get filtered, context sensitive results. Essentially, all actions that are valid for this graph.

> How do you ensure that the Spline  
> references the arrow shape?

Here I’m adding an `Arrow Component` - it’s just a debug arrow helping visualise things. You have snazzy looking static mesh arrows, you should definitely use those! As in:

 ![313989-screenshot-2020-09-17-095841.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/3/d63f5d686ba58a4958d0bfc7c7e0723e25c7c8ff.jpeg)

If you needed each arrow to be a separate actor (because it has complex enough behaviour of its own), that’s fine too. Rather than adding simple static meshes, you can `Spawn Actors from Class` and position them on the spline. Think of the spline as a controller managing other actors’ initial position (which can be later updated run-time).

A note here, one can no longer Spawn Actors in the `Construction Script` directly. Spawning needs be wrapped in a function first and then executed in the CS. Or use the Begin Play event instead.

> I currently have an Arrow Actor  
> Blueprint, which sets the material of  
> the Arrow mesh and incorporates a  
> bouncing animation. Will my Spline  
> need to reference a mesh, rather than  
> an Actor Blueprint?

Up to you, really. If each arrow needs to have a life of its own, an actor might be necessary. For the above, if that’s all what’s needed - the spline actor can probably manage that by stepping through all the static mesh components.

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 17, 2020, 11:10am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/5 "2020-09-17T11:10:29Z")

</div>

That is excellent, thanks for this. I have made some more progress based on your instructions.

I have encountered two issues, which are outlined below.

1. When I make changes to the Spline (such as adding more arrows or changing my spline curve), the Actors tend to ‘duplicate’. I have attached a screenshot of the issue and the code.
2. When I curve the spline, the arrows do not keep the similar direction, like in the sample .gif you attached earlier. A screenshot is also attached of this (including the ‘duplicating’ issue).

Do you know what I’m doing wrong that is causing this?

Cheers  
Matt

 ![314017-arrowblueprint.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/0/fb074b69664aa4fffdfc96fcf9bc62d9fd5ff990.jpeg)

 ![314018-rotate.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/2/ca20bf8873c459ef076951f53268151db1d1e77b.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 17, 2020, 11:44am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/6 "2020-09-17T11:44:12Z")

</div>

All kinds of crazy, I see 🙂

Here’s the thing. What you call a `Mesh` here is not really a mesh, it’s an `Actor`. The spline is creating `Static Mesh Components` and sends them to that _target_ actor. That actor becomes the parent of the meshes and they can no longer be destroyed by the Construction Script of the spline actor.

* * *

If the goal is to use just static mesh components for arrows:

- in the spline actor, create a variable of Static Mesh type and flag it as Instance Editable
- after adding a static mesh component, set its static mesh to that variable

 ![314007-screenshot-2020-09-17-123500.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/9/d19a708bb80010c6ef3e43046c1773be003650c4.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/7/58789803fbe9d48b85fe50d501a6e71ea9ed3de0.gif)](https://gyazo.com/64a67c3ab1eb040a1bc7e56acc8bc578)

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 17, 2020, 11:59am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/7 "2020-09-17T11:59:21Z")

</div>

Thanks again, mate - I am getting success with this! It’s looking great.

I actually do want to use an Actor rather than a Mesh (apologies for the confusion in my mislabelling). The reason I want to use an Actor for the arrows is because the Actor has a code in it that makes the arrow bounce up and down.

Is there a way to make the arrows come from an Actor and still keep the same spline functionality as if it were calling the arrow mesh (which keeps the arrows facing the right direction and with the ability to be ‘destroyed’ by the construction script)? If not, I’d imagine I can just copy and paste the ‘bounce’ code into the Spline blueprint.

Cheers  
Matt

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 18, 2020, 6:25am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/8 "2020-09-18T06:25:38Z")

</div>

To be honest, spawning actors with the Construction Script is asking for trouble. The engine explicitly asks you not to. There are workarounds / hacks but they’re usually not worth the fuss in the long run.

If you can get away with creating components only, absolutely do so. I can chip in with helping implementing an animation of multiple elements driven by a single timeline or tick.

From the performance and the memory footprint point of view, 12 static mesh components is _much more elegant_ than 12 actors, especially as far as Ticking is concerned.

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 18, 2020, 8:57am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/9 "2020-09-18T08:57:00Z")

</div>

Cool, thanks for clarifying that - you’ve saved me lots of time of trying to spawn actors and make it work. If the engine asks us not to do that, I’m going to leave it alone.

I’ve tried to animate the Spline via the EventGraph (code attached). You will probably notice this right away: The code animates my spline, but not the meshes attached to the spline. I cannot seem to figure out how to animate the meshes rather than a spline, and I’m wondering if it’s maybe not possible with the way I am trying to do it.

Can I please take you up on your offer to help implement the animation for this? Feel free to chuck a tutorial video or documentation my way - I’m conscious of the fact that you’ve spent a fair bit of time helping me out already.

Thanks again for all the help. You’ve also well and truly answered my initial question, so I’ll mark this question as answered.

Cheers  
Matt

 ![314123-eventgraph.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/4/b944074882e473797bd894a0f941f8852233ea23.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 18, 2020, 9:48am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/10 "2020-09-18T09:48:14Z")

</div>

Ah, I think I’m getting a better picture of this.

I run this event in the Construction Script:

 ![314125-cs.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/0/c90491be9c8b646ea1a64cee87f2299dfcfea643.jpeg)

Do note how the components are now added to a `Static Mesh Component` array so we can keep track of them. This allows me to preview the result in the world and manipulate the spline any way I need:

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/4/694d828e9bb2864d6ccf45499347d2bfa13a24b4.gif)](https://gyazo.com/9c3d8a05cc689cd21f87fdf830c5f26f)

The arrows are not aware they’re attached to a spline, they will not follow it. The Construction Scripts actually executes every frame and recreates everything from scratch, creating the illusion that objects are attached!

Instead, we animate a spline point and ask the array to update the position of its elements:

 ![314128-graph.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/c/5/3c51ac18222797fb5737b3b06897a4df46b40c34.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/1/af1f54faf6ed990d63149faa9aabb4e3ef0fca94.gif)](https://gyazo.com/3410183f38cce09e9641c8332140f956)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/6/dc60b8b7a6b56fa253eab3c84edd334c1cb00bad.gif)](https://gyazo.com/6d192df572a6319b2cdf768560f43e08)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 18, 2020, 10:13am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/11 "2020-09-18T10:13:20Z")

</div>

Seeing where this _might_ be going, I wonder if it wouldn’t be better to use `Spline Mesh Components` for this. It’d probably make things more efficient since they naturally mesh (ehm) with splines.

Perhaps you could briefly demonstrate what’s the end goal here is. As in, what purpose will these serve and what functionality is required.

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 18, 2020, 11:08am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/12 "2020-09-18T11:08:13Z")

</div>

The end goal is for all the arrows to bounce up and down (the code that was used to create this animation is taken from the answer here: [https://answers.unrealengine.com/questions/983148/view.html](https://answers.unrealengine.com/questions/983148/view.html))

However, what you have done looks super cool and I’d like to know how to do that too.

I have tried to follow along with the screenshots you have posted and I have gotten a bit lost/ran into some issues (probably just because I’m new to Unreal and I’m still getting used to how it all works). May I please have the Blueprint file that you have made so I can analyse it? That would be very useful and I’m curious to see how you’ve achieved this.

Cheers  
Matt

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 23, 2020, 7:55am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/13 "2020-09-23T07:55:20Z")

</div>

Hey Everynone, I’m not sure if this will give you a notification or anything - I was just hoping to follow up on my previous message. Is it alright if I get the Blueprint file that you have made for analysing? I think that if I can see exactly what you’ve done, I can modify it to get what I’m trying to achieve.

Please let me know if any clarification is needed.

Cheers  
Matt

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 23, 2020, 8:57am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/14 "2020-09-23T08:57:12Z")

</div>

I did not save it. I just have the very basic arrow thing from the very first pic. Sorry.

* * *

But 100% of the script is in the last 2 screenshots. It’s all in the same blueprint, in the same graph. The _Create Arrows_ custom event is called in the _Construction Script_.

Is there a particular element that acts up?

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 24, 2020, 11:18am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/15 "2020-09-24T11:18:20Z")

</div>

Hey, I have tried to replicate your Blueprint again, but it’s not really working properly. There’s probably a detail or two that I have missed.

The Blueprint file can be downloaded here: [https://drive.google.com/file/d/131XM9-zi56fY8r36m7h5Je4begThkbym/view?usp=sharing](https://drive.google.com/file/d/131XM9-zi56fY8r36m7h5Je4begThkbym/view?usp=sharing)

If you get the time, could you possibly take a look and let me know what I’ve missed? That would be really appreciated if you could.

Cheers  
Matt

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 24, 2020, 12:47pm UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/16 "2020-09-24T12:47:07Z")

</div>

Here’s what I noticed on my end:

- the Arrows int was set 0, resulting in no components being added
- no mesh was set for the AddStaticComponent (might’ve disappeared when the asset was imported)
- the Timeline was not playing, set it to autoplay (note the icons in my pic)
- the Timeline’s max value was set to .5 while Lerp needs alpha in the 0-1 range
- the Lerp node needs values to interpolate between, both were 0 (set to -100 | +100 Z respectively for that enticing up / down wiggle 🙂
- the spline had only 2 points [0,1] so the static mesh at the end - the point being animated - would spasm out

* * *

Also, weirdly enough:

- the asset transfer broke the construction script calling the event and it was no longer clearing elements from the array, added Clear array manually

Fixed (fingers crossed!) all of the above, link to the project:

> **[MyProject31.rar](https://drive.google.com/file/d/10puNJ26xeepnmq3PVIEdS9JWgSp37_er/view?usp=sharing)**
>
> Google Drive file.

Do tell whether it behaves any better.

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [September 25, 2020, 7:53am UTC](https://forums.unrealengine.com/t/curve-a-series-of-objects/471428/17 "2020-09-25T07:53:25Z")

</div>

Thanks for this! This has resolved everything. I tried to go through your points with my original blueprint, but I still failed so I downloaded your Blueprint and changed parameters with my meshes - it works a treat!

EDIT: I think it’s because when I tried to add more points to the spline, UE crashed. So I downloaded your Blueprint.

Also, I modified the blueprint to get the ‘bounce’ that I was originally looking for. In case anyone is interested, I have uploaded a screenshot of the modified section of the blueprint that achieved this (it’s probably not the cleanest way of doing it, but it works).

The wiggle effect is really cool, however, and I think I’m going to use it and play around with it as well.

Thanks, Everynone, for all the help on this! It has been very useful and is appreciated.

Cheers  
Matt

 ![315538-blueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/f/c9f801678310525cd27163c92d926425e033371c.png)
