• SWEP Laser Aim
    5 replies, posted
Hi everyone, i've been coding SWEPs for a little while now, either from scratch or with a weapon base. I don't release them, as they usually have been done before, just I like changing them a bit, or adding ironsights etc. However, I've recently come into a pistol that I'd like to have a laser aim on. I've managed to get the same effect as the wiremod laser pointer, however that shows a beam all the way to what your pointing at, rather than just a dot where you are aiming. Is anyone willing to help me here, or just point me in the right direction? Thanks
I'm not entirely sure but i think it is just a case of drawing the red dot material at the position where the laser hits.
I'm trying to do it so there is no beam, just the dot, but thanks for the input :)
[QUOTE=rhx123;16925371]I'm trying to do it so there is no beam, just the dot, but thanks for the input :)[/QUOTE] I know. I think you will have to draw a quad in a 3D rendering hook where the player's eye trace hits. [url=http://wiki.garrysmod.com/?title=Player.GetEyeTrace]GetEyeTrace[/url] [url=http://wiki.garrysmod.com/?title=Render.SetMaterial]render.SetMaterial[/url] [url=http://wiki.garrysmod.com/?title=Render.DrawQuadEasy]render.DrawQuadEasy[/url]
Thanks for your help, don't know if it works yet but if I dont post back assume its worked. Thanks a ton.
Also remember to use the trace result HitNormal for the quad to appear correctly.
Sorry, you need to Log In to post a reply to this thread.