Topic was automatically imported from the old Question2Answer platform.
Asked By
irmantus
Navigation2D get_simple_path() returns navigation nodes and I can lerp from one node to another, but how can I lerp or tween whole path. I.e. RTS style space ship should build up speed at start and slow down at the end of the path.
You can use the PathFollow node by adding the returned path to the curve2D on a Path2D node.
for i in navigation_path.size():
Path2D.curve.add_point(navigation_path[i])
#and use this in _process
PathFollow2D.unit_offset = lerp(PathFollow2D.unit_offset, 1, delta)
Without a PathFollow2D you can’t use a single lerp or tween but you can lerp through the array using lerps like this