- Home /
how to do a laser pointer
i need help finding out the best way to make a laser pinter, up to now i have tried using a spotlight, and the only other way i can think of is to have a ton of spheres spawn and move in a certain direction, but it doesent seem to ba an efficient way to do it, if you know of anny other way, pleas tell me
Answer by Yokimato · Dec 15, 2012 at 03:50 PM
I think you'd get a better result (visually and performance wise) if you chose to attack the problem with `LineRenderer` instead of using an actual `Light` object.
Take a look at the LineRenderer documentation. If you tweak the color to be red (or whatever color your laser is) and adjust the alpha to give it a transparent look, I believe this could solve your problem.
I've used this in the past as well. Line render works great. If you want the line to not cut through objects it's also a good idea to do a RayCastHit (Docs) from the laser's origin. Use the hit.point as the last position in your LineRenderer.
Your answer
Follow this Question
Related Questions
I need help with a firing script 1 Answer
shooting laser to screen middle doesnt work... 1 Answer
Laser line 1 Answer
laser pointer 1 Answer
Steamvr laser pointer not interacting with ui buttons 2 Answers