- Home /
How to create Dashed lines in unity
Hi everyone im trying to create some dashed lines for a road network im creating. In the pic i have im trying to get the yellow lines to be dashed lines but so far i havent been able to find any assets to help me in doing that so could anyone recommend to me any assets or how to write a script that would be able to get those yellow lines to be dashed please (PS: The Lines were created with the mesh renderer)
thanks
Answer by highpockets · Apr 04, 2019 at 07:55 AM
-You can make plane and apply a texture to it in blender or your favorite 3D modelling software. You can even draw directly in blender. I would suggest looking at some tutorials for how to do this, it's quite an easy process if you are simply doing 2 dimensional art work.
Another option is to write a custom shader that writes over the yellow pixels/fragments with the grey color.
The least optimized approach would be to make each dash a separate game object. To do so, you just create a quad and scale it to your dash size put a yellow material on it and place the dashes.
I really think that a short tutorial on blender will make your life a lot easier. Take a look at this beginner tutorial:
Your answer
Follow this Question
Related Questions
there is no renderer attached to the "player" game object, but script is trying to access it. 0 Answers
Rendering large amount of lines 2 Answers
How do I add a material to all of a parent's children and have the changes persist (ie w/ script)? 0 Answers
Trying to make a side scroller. I'm following a tutorial and getting this error. 1 Answer
How to achieve Dynamic Gizmo DrawLine() 0 Answers