# How to streamline coordinates to PathFollow3D

**URL:** <https://forum.godotengine.org/t/how-to-streamline-coordinates-to-pathfollow3d/147972>\
**Category:** Help\
**Tags:** gdscript, 3d, godot-4\
**Created:** [December 1, 2026, 7:17pm UTC](https://forum.godotengine.org/t/how-to-streamline-coordinates-to-pathfollow3d/147972 "2026-12-01T19:17:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Testamala](https://forum.godotengine.org/letter_avatar_proxy/v4/letter/t/9f8e36/32.png) [@Testamala](https://forum.godotengine.org/u/Testamala)\
**Post date:** [December 1, 2026, 7:17pm UTC](https://forum.godotengine.org/t/how-to-streamline-coordinates-to-pathfollow3d/147972/1 "2026-12-01T19:17:29Z")

</div>

### Godot Version

4.7.2 stable

### Question

I’m working on a toy train game where the tracks branch out along the walls and surfaces and where the player has different points of interest to visit. I’m working the movement in the following way: the train is a PathFollow3D that follows the tracks which are Path3D and I have a set of Markers3D that specify the Vector3 global coordinates of my points of interests.

The issue I’m having is that I can’t figure out how to translate the Vector3 coordinates to a progress or progress ratio value in my PathFollow3D.

I’ve tried a bunch of ways, including creating Area3D for my Markers and a new PathFollow3D that works as a “surveyor” let’s say, but that turned out to be incredibly slow and unreliable.

Does anyone have an idea how to attack this problem? or knows of an addon that already deals with this?

---

<div class="post-metadata">

**Author:** ![normalized](https://forum.godotengine.org/user_avatar/forum.godotengine.org/normalized/32/58558_2.png) [@normalized](https://forum.godotengine.org/u/normalized)\
**Post date:** [December 2, 2026, 2:45am UTC](https://forum.godotengine.org/t/how-to-streamline-coordinates-to-pathfollow3d/147972/2 "2026-12-02T02:45:28Z")

</div>

For each marker point

- transform marker’s global position into Path3D’s local space by multiplying Path3D’s global transform inverse with marker’s global position.
- Call `get_closest_offset()` on path’s curve, passing it marker’s local position. This will return the distance along the curve from its start to the point on curve that is closest to the given point.
- Divide that distance with `curve.get_baked_length()` and you’ll get the percentage of the total curve length to that point.
