How do I get points on a curve until an interpolated offset?

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

say I have an offset that I can use to interpolate with a curve2D, how would I get all of the points leading up to that offset?

I have tried the following code, which has been unsuccessfull:

func add_curve_points():
	var curve = $Path2D.curve
	var offset = curve.get_baked_length()*t
	var baked = curve.interpolate_baked(offset)
	for point in curve.get_baked_points():
		if point == baked:
:bust_in_silhouette: Reply From: SigilQuiver

it turns out the answer is to just use the bake interval of the curve2D

func add_curve_interpolate():
	var bake_interval = curve.get_bake_interval()
	var offset = curve.get_baked_length()*t
	for interpolate_offset in range(0,offset,bake_interval):