# Niagara Spline data interface closest unit distance

**URL:** <https://forums.unrealengine.com/t/niagara-spline-data-interface-closest-unit-distance/468330>\
**Category:** FX\
**Tags:** spline-mesh-componen, unreal-engine, question\
**Created:** [July 18, 2020, 9:46am UTC](https://forums.unrealengine.com/t/niagara-spline-data-interface-closest-unit-distance/468330 "2020-07-18T09:46:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NielsDewitte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nielsdewitte/32/606994_2.png) [@NielsDewitte](https://forums.unrealengine.com/u/NielsDewitte)\
**Post date:** [July 18, 2020, 9:46am UTC](https://forums.unrealengine.com/t/niagara-spline-data-interface-closest-unit-distance/468330/1 "2020-07-18T09:46:22Z")

</div>

The **“Find closest Unit distance from position WS”** node is not working as expected

I’m attempting to find a WS position on the spline closest to a provided WS position

 ![307491-fcdtp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/6/416661c19161bdf34f636955646eabb9dbb40324.png)

In the following example, I use the above script to set Particles.Target on particle spawn.  
Then in the update script I quite simply animate between the original sample position (source) and the target.  
I also added a colour change from Red to Blue so we can see the transition between source and target.

Near the 0-1 ranges of U this does what is expected, the particles move to the closest points near them on the spline.  
However in between that, we can see the particles move drastically from their original spawn position to a point on the spline really quite far away.

![307492-splineproblem.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/8/a78fec7154f37ae615ba4d7307aef393459d5ba8.gif)

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/d/0ad81b42ecf46a58f0ff901085f3a3b395876b3d.gif "Animated GIF - Find & Share on GIPHY")

I cannot for the life of me figure out what it is that I am missing

---

<div class="post-metadata">

**Author:** ![Alex\_Chozabu\_P-B](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alex\_Chozabu\_P-B](https://forums.unrealengine.com/u/Alex_Chozabu_P-B)\
**Post date:** [January 11, 2021, 3:34pm UTC](https://forums.unrealengine.com/t/niagara-spline-data-interface-closest-unit-distance/468330/2 "2021-01-11T15:34:08Z")

</div>

Similar issue here.  
Seems as if the problem is worse with a longer more complicated spline…  
Also worth noting, using normalised particle age gets good results?

---

<div class="post-metadata">

**Author:** ![Deceptive\_Taco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deceptive\_Taco](https://forums.unrealengine.com/u/Deceptive_Taco)\
**Post date:** [July 8, 2021, 3:26am UTC](https://forums.unrealengine.com/t/niagara-spline-data-interface-closest-unit-distance/468330/3 "2021-07-08T03:26:11Z")

</div>

I know it has been a while, but this is the kind of effect I’m hoping to achieve in order to affect smoke trails. I can’t, for the life of me, find anything in documentation or tutorials about making the particles themselves, follow a spline. I only find stuff about making a particle system animate along the spline or spawning particles on a spline. Is there any resource or tutorial you used to achieve the above effect that you could point me toward? Thanks!
