+2 votes

Hello,

Can someone help me on how to create a dashed or dotted line in Godot?
Seems stupid, but can't find how. There is an easy way or need to create a lot of dots over a path ?

This is my actual line code:

draw_line(initialPos, finalPos, color, 2)

Thank you!

in Engine by (39 points)

1 Answer

+1 vote

If I'm not wrong there is no direct method to do it. But you can create a function that draw multiple smaller lines, given initialPos, finalPos, length and distance between lines.

by (101 points)

you could use a dashed line texture

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.

Categories