- Home /
Draw raycast in final build
i have raycasts working and everything is fine there, i just wanted to know if there was a way i could write the draw line code so it draws in the final build. not just for debugging. thanks.
Answer by SlyyGuyy · Apr 17, 2014 at 02:59 PM
Here are a few questions that have answers to the same issue that you're having:
http://answers.unity3d.com/questions/338349/converting-debugdrawlines-to-in-game-lines-screens.html
http://answers.unity3d.com/questions/373954/draw-raycast-problem.html
Also, if these don't work, it's beneficial to see your code and what you're attempting to do so that we can see how to better assist you.
Answer by Owen-Reynolds · Apr 17, 2014 at 04:16 PM
Thinking of it as a raycast just complicates it unnecessarily. Call the raycast start A, and the hitPoint B. Now it's just a line between two points. LineRenders work. Or just the "center, scale and LookAt" method (using maybe a semi-transparent cylinder.)
i dont want to draw geometry. just the color, and length of a debug raycast in the final build.
If you really like the way that scraggly line looks, but consider this: DrawRay is ugly, sometimes hard to see, can't tell Start from Stop, and doubtless on Unity's the list of gadgets to improve.
So why not make a nice one for yourself, esp. since it's easier than duplicating theirs?