• Drawing a second pair of viewmodel hands
    4 replies, posted
Hello I'm attempting to make a throwing system, where upon pressing a specific bind, the player lowers their weapon and throws a grenade. The throwing will be handled by a separate model that utilizes the c_model system, however I'm having issues getting the gmod_hands entity to show up for this new viewmodel and I was wondering if anyone had tackled this in the past. A 3D cam lets me make a second model of the gmod_hands, but this one will follow the exact animations of the current viewmodel only. Replacing the current viewmodel entirely won't work because SetCycle doesn't work on viewmodels, meaning I can't start the animation from 0. Creating a new weapon and switching to it will work, but it's not what I want. Using the second viewmodel system with SetWeaponModel has been the best success I've had, but it removes the hands from my viewmodel 0 and gives them to viewmodel 1. All the dual wielding mods I've seen use v_hands instead of c_hands so they aren't of much help either. Attempting to create a second pair of hands hasn't seemed to work for me (they just refuse to show up, because of a gamemode hook overriding them if I'm not mistaken?). Any suggestions?
Why not use a ClientsideModel for the other set of hands? The only drawback I could potentially see is that ClientsideModels don't get affected by projectedtextures
As Gmod4phun said, render a model client-side with ClientsideModel, set its model to the hands model you will use, set its position and parent to be the view-port of the client and then run a throwing animation on the client-side model.
Maybe I'm just dumb, but how would I SetModel twice? I'd have to SetModel once to assign the hands model to match with the player's, and then I'd have to SetModel a second time for the hands to be able to play my animation. Won't doing the second SetModel overwrite the first, making the hands invisible again?
You don't really need to set the hands movetype, angle or pos, bonemerging them is all you need to do. However, upon creation, use SetNoDraw(true) on them (and the viewmodel), that should fix the double hands problem. Also, using PostDrawViewModel might be more suitable than RenderScreenspaceEffects I think.
Sorry, you need to Log In to post a reply to this thread.