# Follow mesh with inertia

**URL:** <https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695>\
**Category:** Questions\
**Created:** [February 25, 2021, 10:09pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695 "2021-02-25T22:09:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abner\_Corona](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/abner_corona/32/14314_2.png) [@Abner\_Corona](https://forum.babylonjs.com/u/Abner_Corona)\
**Post date:** [February 25, 2021, 10:09pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695/1 "2021-02-25T22:09:22Z")

</div>

Is possible to recreate the path of the demon like this video  
[(30) Warcraft 3 Reforged - Hungry Felhounds - YouTube](https://www.youtube.com/watch?reload=9&v=dyDqLFNr5Vk)  
Here is my playground thanks!!  
[Follow demon | Babylon.js Playground](https://playground.babylonjs.com/#6YFZFB#6)

---

<div class="post-metadata">

**Author:** ![Abner\_Corona](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/abner_corona/32/14314_2.png) [@Abner\_Corona](https://forum.babylonjs.com/u/Abner_Corona)\
**Post date:** [February 25, 2021, 10:17pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695/2 "2021-02-25T22:17:38Z")

</div>

Here another test  
[Follow demon 2 | Babylon.js Playground](https://playground.babylonjs.com/#6YFZFB#7)

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [February 26, 2021, 5:46pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695/3 "2021-02-26T17:46:49Z")

</div>

Hey @Abner_Corona.

My apologies. I’m not quite sure I understand the request here. Could you help elaborate a little bit about what you’re trying to do?

Thanks!

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 26, 2021, 5:57pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695/4 "2021-02-26T17:57:58Z")

</div>

demon.position = BABYLON.Vector3.Lerp(demon.position, target.position, smoothingSpeed)

---

<div class="post-metadata">

**Author:** ![owen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/owen/32/9325_2.png) [@owen](https://forum.babylonjs.com/u/owen)\
**Post date:** [February 26, 2021, 6:34pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695/5 "2021-02-26T18:34:20Z")

</div>

Based on the youtube video that @Abner_Corona shared I believe what is desired is bit of “slip and slide” and “over shooting” … a little “tokyo drift”. Whereas in the playground the demon follows the target a little too well, it’s right on top of it and the movement is completely straight and linear.

I’m not an expert at this but @Abner_Corona maybe try separating the rotation (lookAt) from the translation (follow) to have different “rates”. To me, it seems that the illusion of this deer slipping on ice comes from turning toward the target immediately (continue to update lookAt on every frame), but not updating position to target on every frame, or rather, maintaining the direction where it was previously going as if it can’t stop itself due to momentum.

Just an idea to try is using some setInterval that sets an animation on the demon to go where the target is, and just let it play out to move the demon from point A to point B over a number of frames with some easing function. On the next setInterval cancel the previous animation and create a new one, doing the same thing for the new target position and so on. That might make it seem like it’s so forceful in moving to a place that it can’t stop itself.

[https://playground.babylonjs.com/#6YFZFB#11](https://playground.babylonjs.com/#6YFZFB#11)

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 26, 2021, 6:37pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695/6 "2021-02-26T18:37:24Z")

</div>

[https://playground.babylonjs.com/#6YFZFB#8](https://playground.babylonjs.com/#6YFZFB#8) ← Move to

[https://playground.babylonjs.com/#6YFZFB#9](https://playground.babylonjs.com/#6YFZFB#9) ← Follow  
[https://playground.babylonjs.com/#6YFZFB#10](https://playground.babylonjs.com/#6YFZFB#10) ← Caravan

There are ways to smooth it out even more, with the lookAt having a targetPositiong being lerped as well so they turn smoother. You can also work in inertia systems into this as well to make it way more realistic with motion.

---

<div class="post-metadata">

**Author:** ![Abner\_Corona](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/abner_corona/32/14314_2.png) [@Abner\_Corona](https://forum.babylonjs.com/u/Abner_Corona)\
**Post date:** [February 27, 2021, 9:49pm UTC](https://forum.babylonjs.com/t/follow-mesh-with-inertia/18695/7 "2021-02-27T21:49:41Z")

</div>

Thank you all I really appreciate it!!! if I finish my game I will give you the credits, honor to which honor deserves  
[Follow demon with a little slip and slide thanks | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#6YFZFB#12)
