Hi,
The points from a Path2D node are defined in a Curve2D. This can be access via curve
. You can add points with add_point(coordinate : Vector2)
to the Curve2D
Here is a simple example how to make a "Z" (ZickZack) as a Curve2D for the Path2D:
extends Path2D
func _ready() -> void:
curve.add_point(Vector2(0, 0))
curve.add_point(Vector2(10, 0))
curve.add_point(Vector2(0, 10))
curve.add_point(Vector2(10, 10))
I hope this will help you.