• AR2 Model Idle Animation after Reload (SWEP)
    3 replies, posted
When a SWEP with an AR2 model reloads, it stays in the final reload frame and looks odd until you shoot. How do I force it to go back to it's idle after reloading?
The same way you play attack animation, but using ACT_VM_IDLE instead of ACT_VM_PRIMARYATTACK.
[QUOTE=Robotboy655;46023528]The same way you play attack animation, but using ACT_VM_IDLE instead of ACT_VM_PRIMARYATTACK.[/QUOTE] I don't play the attack animation manually...? [code]function SWEP:PrimaryAttack() if ( !self:CanPrimaryAttack() ) then return end self.Weapon:EmitSound("/weapons/ar2/fire1.wav") self:ShootBullet( 9, 1, 0.014 ) self:TakePrimaryAmmo( 1 ) self.Owner:ViewPunch( Angle( -2.8, 0, 0 ) ) self.Weapon:SetNextPrimaryFire( CurTime() + 0.215 ) end[/code] [editline]edit[/editline] Using this code: [code]function SWEP:Think() if CurTime() >= self.ReloadingTime then self:SendWeaponAnim( ACT_VM_IDLE ) end end[/code] I can manage to get it working. But then it spams script errors.
self:ShootBullet does. Tip: Use self:SendWeaponAnim( ACT_VM_IDLE ) in the reload hook with a timer and self:SequenceDuration() for an easy solution.
Sorry, you need to Log In to post a reply to this thread.