0 votes


I want to animate the graph of a function in Godot. The problem is that the function I'm trying to animate doesn't have a formula, as I plotted it with experimental values (see the picture).

Thus, I've tried to create a Path2D with the bezier curves to then have a child point that I could slide on the curve. Everything works great, but I've got a problem with the units used.

If I plotted a function, and asked for the point in the middle of the graph, it would be easy, i would have to check y[x/2]. But here, as the unit is the length of the courb, it won't work.

the courb

Is there a way to have a relation between 'x' as the absciss unit and 'l' as the unit used by PathFollow2D, which is a fraction of the length of the courb?
Or is there another way to do what I want?


in Engine by (86 points)

Please log in or register to answer this question.

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.