# Get speed of a skeletal mesh moving along a spline

**URL:** <https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384>\
**Category:** World Creation\
**Tags:** timeline, unreal-engine, velocity, Spline, UE4, question\
**Created:** [September 24, 2018, 9:06am UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384 "2018-09-24T09:06:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [September 24, 2018, 9:06am UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384/1 "2018-09-24T09:06:12Z")

</div>

Hi,  
I’m moving an actor (skeletal mesh) along a pline using a Timeline.  
How can I get the speed of the mesh ? The mesh does NOT use physics and is NOT a pawn, so I can’t “get linear velocity”. I’ve tried to get the world location difference between old position (frame f) and the new one (frame f+1) but can’t afford to something coherent. Could someone post a screenshot of a working Blueprint setup ?  
This is why I have now (and this returns me a VectorLength of 0).

 ![254569-capture3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/2/1b2a568ff647eb00b9c0468a47d910c6487eedb7.jpeg)

---

<div class="post-metadata">

**Author:** ![HarryHighDef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HarryHighDef](https://forums.unrealengine.com/u/HarryHighDef)\
**Post date:** [September 24, 2018, 10:07am UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384/2 "2018-09-24T10:07:13Z")

</div>

Your Speed calculation is almost perfect, just remove that multiply by 2 after length and make sure to set old loc after you set speed and it should be fine.

---

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [September 24, 2018, 10:42am UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384/3 "2018-09-24T10:42:46Z")

</div>

Well the x2 is to set the scale of animation speed - doesn’t matter in my issue for now.

I’ve set Old Loc after setting the speed variable, but it gives me an infinite value : PrintString sais “inf”.  
If I set OldLoc Before AND after setting the speed, I get a pretty convenient value (that I have to divide by 10000, though). That’s not much logical…

---

<div class="post-metadata">

**Author:** ![HarryHighDef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HarryHighDef](https://forums.unrealengine.com/u/HarryHighDef)\
**Post date:** [September 24, 2018, 12:24pm UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384/4 "2018-09-24T12:24:46Z")

</div>

Don’t set it before, only set after

---

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [September 24, 2018, 12:54pm UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384/5 "2018-09-24T12:54:13Z")

</div>

With this setup it gave me an infinite value…

---

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [October 1, 2018, 9:42am UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384/6 "2018-10-01T09:42:24Z")

</div>

This setup doesn’t work, is there another way or some unexpected errors ?

---

<div class="post-metadata">

**Author:** ![TheWolf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thewolf/32/1036665_2.png) [@TheWolf](https://forums.unrealengine.com/u/TheWolf)\
**Post date:** [March 12, 2024, 3:27am UTC](https://forums.unrealengine.com/t/get-speed-of-a-skeletal-mesh-moving-along-a-spline/434384/7 "2024-03-12T03:27:33Z")

</div>

Correct. Harry’s edit works.
