2D Dashed Line of Arbitrary Width

Whats the best way to 2d create a dashed line with an arbitrary width that can have 90 degree bends in it and sits on the floor? I tried adapting this https://playground.babylonjs.com/#AMTCWG#1 but used a dynamic texture instead of of image and got equally distorted lines. Thanks

you could probably do it with NME and @PirateJC could help you get started with it ?

Basically you could rely on the UVs to display or not the color the create a dashed effect.

Hey @ambidexterich

I definitely think this is very doable in a shader using the Node Material Editor.

Here’s a small example to get you started. This gives you a moving dashed line where you can control the length of the line, the speed of the line, and the width of the line.



You could probably start with this and then build from the concept to create the 90 degree turns you’re looking for. That part might be a bit tricky, but definitely doable.

Hope this helps!

1 Like

Thanks for pointing me in the right direction, I will have read through the nme documentation.