Is there an easy way to tween the position of a point of a line.

Godot Version

4.2

Question

Hopefully an easy question, as stated above, I want to “animate” a line’s length changing using tweens. The biggest issue is <tween.property> doesn’t accept <“points[1]”> as a property. Transforming the scale of the line wont work either because the line’s offset gets multiplied aswell. Hopefully this is less trouble then it seems. Thanks.

I can only see a script performing this more easily than a Tween.
( btw i never used Tween, i only looked at the documentation )

In the docs there is this interpolation example:
Link

var t = 0.0

func _physics_process(delta):
	t += delta * 0.4

	$Sprite2D.position = $A.position.lerp($B.position, t)

We could change it to

var t = 0.0

func _physics_process(delta):
	t += delta * 0.4

	$Line2D.points[1] = $Line2D.points[0].lerp(Vector2(2,2) # Target position , t)

This would basically interpolate / Animate the line’s length