- Home /
Converting Debug.drawlines to in-game lines? [screenshot inside]
So I've been working on a top down shooting game where your player (the red cube) has a "vision cone" so you can tell which enemies are in your vision. I have this implemented and working with several individual raycasts but up until now I've been showing the players vision by drawing Debug.Drawlines from the players position to the point where each ray hits (the green and red lines). This works great but debug.drawline (as far as I know) only can be used in unity with gizmos turned on. I'm at the point where I would like to test it out with some friends (its an online game using Photon) but it's useless if they cant see their vision cones in the web player. So basically my question is, how should I go about getting lines like these debug.drawline in-game? I assume I would used LineRenderer but I've never used it before and I dont feel like screwing around learning it if theres a simpler/better way to go about it. Thanks a lot
SCREENSHOT: http://imgur.com/EcFNw
Answer by Sisso · Oct 26, 2012 at 11:17 PM
Draw as any other object or effect.
http://docs.unity3d.com/Documentation/Components/class-LineRenderer.html
(taked from http://answers.unity3d.com/questions/8338/how-to-draw-a-line-using-script.html)
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Unity Error on build not in editor? 0 Answers
PhotonNetworking Colliders of players dont collide 0 Answers
Photon Instantiate doesn't always work 0 Answers
Unity/Photon chat system error. 1 Answer