I tried to figure this out a while ago then eventually just gave up. In my sweps with ironsights, I want to stabilize the weapon viewmodel while aiming by freezing the animation, or something like that.
What I've tried:
function SWEP:ViewModelDrawn(vm)
if IsValid(vm) then
vm:SetCycle(0)
self:SetCycle(0)
end
end
Probably a bad thing to do, but calling this in Think:
function SWEP:StableVM()
local vm = self.Owner:GetViewModel()
if IsValid(vm) then vm:SetCycle(0) print("Fucker") end
end
Nothing happens. I've used print to make sure the code is ran, the top one is always ran Client, the Think one is always called Shared. They are being called, but I guess SetCycle isn't working?
Help?
Try changing Entity/SetPlaybackRate to 0 during the ironsight state