• Laser pointer
    5 replies, posted
Hi, i have a really small and simple request, i want to know how do i put something like a RPG laser dot on my screen, like any place i aim the dot appears. I also want to make this dot green. Any help? I've got an example from maurits.tv but it's not what i want actually. The full code for it will be good.
vaza daqui mermão
You can make an EyeTrace and set the laser dot size depending on the distance from the hit pos, and to draw the laser dot in the center of your screen, use for example a PostDrawHUD hook or something.
Thanks, i'll try that
If you end up trying to use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/DrawBeam]render.DrawBeam[/url] to draw the laser line itself, you will need to use a hook such as [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PreDrawViewModel]GM:PreDrawViewModel[/url] or something that takes place in a 3D rendering context.
You should draw it in your SWEP's Draw function to draw it when the worldmodel does.
Sorry, you need to Log In to post a reply to this thread.