How to make dotted or dashed line?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rwrz
:warning: Old Version Published before Godot 3 was released.

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!

:bust_in_silhouette: Reply From: al.glez

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.

you could use a dashed line texture

Ron0Studios | 2020-05-31 12:36

:bust_in_silhouette: Reply From: mingganglee

This is a project I wrote.

I hope it helps.