0 votes

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?

in Engine by (1,964 points)
edited by

1 Answer

0 votes

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)

by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.