• Bullet tracer
    3 replies, posted
Hello Today I decided, to make my own swep. everything is working exept the bullet tracers are wrong. heres a picture: [img]http://img607.imageshack.us/img607/9526/tracerj.png[/img] as you can see, the bullet tracer is at the wrong position. I found out, wich function controls the tracer origin, but I dont know how to do it. this is the function to change the tracer origin: [lua] function SWEP:GetTracerOrigin() return //code end [/lua]
Im not exactly sure because i don't work with SWEPS much. But my guess would be something like this: [lua] local gun = self.Entity local attachmentID = gun:LookupAttachment("ValveBiped.flash") local pos = gun:GetAttachment(attachmentID) return pos.Pos [/lua]
I dont know if that would work in my case, because I scaled down the bone of the AK7 model, until its almost invisible, and then I used the [url=http://www.facepunch.com/threads/1032378-SWEP-Construction-Kit-developer-tool-for-modifying-viewmodels-ironsights]SWEP Constructor Kit[/url] to add some alienswarm models. But thanks for your help!
Its quite tricky to do that, first you have to use the viewmodel attachment the not attachments of the world model, second since the effect is serverside you'll have to suppress the tracer effect being send to the client [b][url=http://wiki.garrysmod.com/?title=G.SuppressHostEvents]G.SuppressHostEvents [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Then you just use util.Effect with the tracer effect on the client.
Sorry, you need to Log In to post a reply to this thread.