Hello,
How would I control/manipulate bones on a SWEP's view model within LUA?
self.Owner:GetViewmodel() and ent:ManipulateBone* functions. Look them up on wiki.
What do you intend to do with it? Depending on the answer to this question I may have a solution
[QUOTE=FlameCow;42800406]I've been trying to do the same thing recently. It worked perfectly until I switched to a SWEP with the same viewmodel as the one I'd modified - that was also under the effects of the bone manipulation. Trying to reset it after the viewmodel has been drawn doesn't seem to be working for me either.[/QUOTE]
Are you using a c_model and if so are you talking about the bones of the weapon model itself, or the bones of the hands? I really want to work out how to hide the left hand in the C4 hold type.
[QUOTE=FlameCow;42801567]Yes, I'm using a c_model. The bones I changed were the arm/hand bones. I don't think it's a viable solution though, since the bone manipulation will 'transfer' to SWEPs with the same model.[/QUOTE]
You should be able to just undo it whenever the swep is holstered, although IIRC correctly I had issues with Holster not being called when changing to the camera weapon (?). Or you could possibly make use of the PlayerEquip hook.
But I guess your issue is the undoing not taking effect, so all I can suggest is make sure the model you are undoing the manipulations on is actually the same one you originally did them to.
Mind if I ask what bone names you use to target the hands?
Like I posted in WAYWO, I'll just restate that SWEP Construction Kit reliably resets bone mods (whenever I have used it); I suggest looking into its holster function and seeing if you can get anything.
What I meant, is for example, on a base like mad, your weapon just sways side to side while walking. On Spy's customizable weaponry, he has his own movement for the view model. Here's a video showing what i'm trying to ask, look how the gun moves when he walks:
[video=youtube;ci7x9a8iWcc]http://www.youtube.com/watch?v=ci7x9a8iWcc[/video]
What you're looking for doesn't actually control the bones of a viewmodel; it uses calcview to reposition it relative to the camera.
GetViewModelPosition(), the standard ironsight system, actually uses calcview.
Well besides this, I had something in mind to make a bf3-like vaulting system with the hands, without having to decompile model and make a vaulting animation:
[video=youtube;5PJ1w0m5TTo]http://www.youtube.com/watch?v=5PJ1w0m5TTo[/video]
Oh so you want to actually make a LUA-based "animation"?
Hmmmm
A thought crossed my mind to use the LUA animation API, but I still have yet to actually try the editor itself... on top of that from demonstration videos it's been shown to work on playermodels, but I've never seen it being used with viewmodels for guns.
[url]http://facepunch.com/showthread.php?t=821202[/url]
Sorry, you need to Log In to post a reply to this thread.