• Help With Swep
    2 replies, posted
I am currently making a weapon that is essentially the gravity gun, but it replaces the right click ability to spawn a object rather then pull it. The problem I am having is that I don't know the code or proper way to make the primary fire use the gravity gun's punting ability to shoot said object.
The original Gravity Gun code is in C++ and so the original code would not be useful for you. One way you can do this, is to set the force on the 'bullets'. Take a look at this [url]http://wiki.garrysmod.com/page/Structures/Bullet[/url] Another way is to use a trace, to get the object you want to push, and then use this [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/PhysObj/ApplyForceCenter]PhysObj:ApplyForceCenter[/url]
[QUOTE=smithy285;48282575]The original Gravity Gun code is in C++ and so the original code would not be useful for you. One way you can do this, is to set the force on the 'bullets'. Take a look at this [url]http://wiki.garrysmod.com/page/Structures/Bullet[/url] Another way is to use a trace, to get the object you want to push, and then use this [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/PhysObj/ApplyForceCenter]PhysObj:ApplyForceCenter[/url][/QUOTE] Alright, i'll take a look at it and see what I can do. Thanks.
Sorry, you need to Log In to post a reply to this thread.