Difference in how Bézier curve control points operate in the editor and in code

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

When I draw a path for a Path2D curve in the editor, I can create curves in the path using the control points of each point. I can extend the control a certain distance, and the line will curve in an intuitive fashion. When I create a Curve2D, however, things are different. I can add points to the curve via the add_point() function. One of the parameters for add_point() allows the programmer to specify the in and out control points. When I specify a control point near the point in question, however, the curve varies radically. The distance between the control point and the originating point could be small, yet the curve to that line segment is quite large. Could anyone shine some light on why this is?

:bust_in_silhouette: Reply From: swren02

The in and out control point variables in add_point() are relative to the first point. So in your case to put the control points near the original just do something such as add_point(Vector2(100, 100), Vector2(3, 4), Vector2(2, 1) INSTEAD OF add_point(Vector2(100, 100), Vector2(103, 104), Vector2(102, 101)