How to tween line2d add point

Currently i am working on input based game which does not use “process” methods much (aside from dragging). I need to tween line2d add point method but could not find anything useful for my case. I checked tween the documentation and couldnt find anything useful.

Could you elaborate on what you mean by tweening add point?

Are you trying to add a bunch of points between two points? In that case you could do

tween.tween_method($Line2D.add_point, pointA, pointB, duration)

Thanks, but with your method it started behaving erratically (check second, first one is ok). Tried both await or none. My line2d only moves in one axis for each point. I think your method adds too many points maybe? I need to solve this with only one point.


Below somehow worked but need better i think. Shortly, adding a new point in the same position with the last one then tweening method.

var tween = get_tree().create_tween()
low_line.add_point(flow_line.points.get(flow_line.points.size() - 1))
var last_point_index = flow_line.points.size() - 1
await tween.tween_method(change_last_point_pos_for_tween, flow_line.points[-1], new_point, 0.15).finished
#flow_line.add_point(new_point)	


func change_last_point_pos_for_tween(point:Vector2) -> void:
	var last_point_index:int = flow_line.points.size() - 1
	flow_line.set_point_position(last_point_index, point)

I’m kind of lost. Are you only trying to interpolate the last point?

In that case you could do

tween.tween_method(func(p: Vector2): flow_line.points[-1] = p , flow_line.points[-1], new_point, 0.15)

Could you describe what is this flow line thing you are using this for? Because I’m honestly not entirely sure what the intended behavior of the line is supposed to be