• Getting the "pistol" part of the viewmodel
    5 replies, posted
I would like to get rid of the "pistol" part of the swep, but idk how. When I receive the viewmodel it is with the hands, when I would like to have a pistol part of models/weapons/v_pistol.mdl Is there a function or something? Thanks :D
There is no simple way to do this, however, you can do some very hacky bone manipulating in a clientside BuildBonePositions callback to the viewmodel ([img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/AddCallback]Entity:AddCallback[/url]). Essentially, you have to scale all bones related to the actual pistol model to 0 with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/ManipulateBoneScale]Entity:ManipulateBoneScale[/url], then move their position with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetBonePosition]Entity:SetBonePosition[/url] to their first visible parent. [editline]24th August 2017[/editline] But it would be easier to just edit the model in Blender.
You could override the submaterial of your viewmodel at the needed index to be a fully transparent material or something
Maybe use the c_pistol variant? That one comes with the hands removed by default
[QUOTE=Gmod4phun;52611716]Maybe use the c_pistol variant? That one comes with the hands removed by default[/QUOTE] He wants the pistol removed, not the hands.
[QUOTE=code_gs;52612124]He wants the pistol removed, not the hands.[/QUOTE] Sorry, got confused with what he said in the second sentence, kinda contradicting the first one
Sorry, you need to Log In to post a reply to this thread.