• Gravity Gun, Controling the ending tips
    11 replies, posted
The gravity gun has those 3 tips that extend and retract whenever say you are looking at a close prop, you know what I mean... Question is how do I make it change the position of the metal tips? It's definetly not an animation (SendWeaponAnim).
It's a poseparameter, "active" I think.
[QUOTE=Nevec;25720503]It's a poseparameter, "active" I think.[/QUOTE] You can't set the "active" (this issue only happens with view,not with worldmodels) poseparameter if you already have the gravity gun in your inventory. Example,grab an entity and switch to the physgun,as you can see,the gravity gun will override the physgun's viewmodel pose parameter. I fixed it by renaming the viewmodel's pose parameter (i also added the super physcannon skin). Fixed viewmodel with "prong_open" pose parameter and normal/super gravity gun skin. [url]http://www.mediafire.com/?wa62mk7kdjdbw1w[/url] [b]Only use my "fix" if you want the player to keep the gravity gun[/b],if the gravity gun will not stay in his inventory,then just do Viewmodel:SetPoseParameter("active",value)
Ok I used SetPoseParameter on the weapon, but it only changes the world model and not the view model
[QUOTE=Jackthemaster;25731346]Ok I used SetPoseParameter on the weapon, but it only changes the world model and not the view model[/QUOTE] You need to set it on the weapon [b]and[/b] to the viewmodel.
self.Owner:GetViewModel():SetPoseParameter( "active", 1 ) How come this won't work?
[QUOTE=Jackthemaster;25748548]self.Owner:GetViewModel():SetPoseParameter( "active", 1 ) How come this won't work?[/QUOTE] It will not work if the gravity gun is in your inventory. Post your code,or at least the part where you set the pose parameter.
[lua] function SWEP:Think() self.Owner:GetViewModel():SetPoseParameter( "active", 1 ) self.Weapon:SetPoseParameter( "active", 1 ) end [/lua]
Is this shared?
Yes
The only thing I've seen using this is the punt cannon on toybox (which uses a custom model), and it seems to me that Jvs made this so I'm gonna leave this to him.
[QUOTE=Jackthemaster;25748875][lua] function SWEP:Think() self.Owner:GetViewModel():SetPoseParameter( "active", 1 ) self.Weapon:SetPoseParameter( "active", 1 ) end [/lua][/QUOTE] Always check if the gravity gun is in your inventory while trying your weapon,i can't stress it enough. Also,add some IsValid checks before using the setposeparameter on the viewmodel,self.Weapon is always valid tought,the viewmodel might not.
Sorry, you need to Log In to post a reply to this thread.