0 votes

I want to create a straight line trail for a ball spawned in the scene. Particles2d creates a discontinuity in the trail as particles are emitted with gap between successive particles. How can I make a straight line trail with its width equal to width of the ball?

in Engine by (77 points)

1 Answer

0 votes

have you had a look at a Line2D?
you can simply set two points for your line. one would be Vector2(0, 0) and the second would be -ball_velocity.normalized() * line_length.
The second point uyou would need to set every physics frame.

by (128 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 Frequently asked questions and 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.