Constant speed on path3d

Hi i want to replace my movement system from collistions to navMesh. I just started to compute path and i cannot get constant speed independently from distance from mesh to target point. I just prepare simple PG to show problem: https://www.babylonjs-playground.com/#X5XCVT#16

Thanks for advice :).

1 Like

Hi, it’s because the path points aren’t evenly separated. Here’s a solution by getting a point on a curve instead (0.0 to 1.0):

https://www.babylonjs-playground.com/#X5XCVT#17

4 Likes

This is not complex solution, bucause sometimes box go slower, sometimes faster. Just check new PG with some fixes:

https://www.babylonjs-playground.com/#X5XCVT#18

Here’s a playground that uses time instead of indices, where the amount of time to take depends on the length of the path:

https://www.babylonjs-playground.com/#X5XCVT#20

1 Like