why get_simple_path() doesn't reach the point defined in "end" argument?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CaptainSweet

Hi,

When I use “get_simple_path()” on an isometric grid, it happens that the last point returned by get_simple_path is pixels away from the one given in Input.

For example (based on an isometric tilemap 64x32):
‘path = get_simple_path(Vector2(0, 0), Vector2(128, 64))’
‘# path = [(0, 0), (64, 32) (125.308, 72.514)]’

Setting optimization argument to true or false doesn’t change anything.

Is this a known issue of get_simple_path() or is there a way to avoid it?

From what I’ve read on the Godot documentation, the get_simple_path() function has known issues (though I don’t know what’s causing the issues). To remedy this, it may be best to check whether the object that’s using get_simple_path() is within a certain margin of its destination, and use the end point when it’s near to the end to “push” the object there.

Ertain | 2022-04-20 07:31

Your idea is good, I just need to make sure that the error at the end point remains reasonable. Thank you.

CaptainSweet | 2022-04-20 08:27