SendWeaponAnim Help

My friend made an animated view model for me but it is buggy cause it isn’t animating to the end.
Any idea?

[lua]
function SWEP:PrimaryAttack()

self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)

end
[/lua]

What do you mean that is isn’t animating to the end?

Anywho… This is the animations fault, there is nothing wrong with the code you posted.

well, the animation is buggy, I can’t describe it. It end before the end of the animation or dunno.

If animation gets cut off before it finishes might be that some other animation is overriding it. If its animations fault then this should probably go to modeling section, you’d get allot better help there.

Well, I recorded it.

Sooo, any idea now?

Seems like the models animation is glitching.

I can see well in sdk

[editline]27th March 2011[/editline]

source sdk

Mind posting your full code? Could be something overriding the animation.

Shared
[lua]
AddCSLuaFile( “shared.lua” )

SWEP.Author = “Dark Ages”
SWEP.Contact = “”
SWEP.Purpose = “”
SWEP.Instructions = “Left click to mine some stone”

SWEP.PrintName = “Stone Pickaxe”
SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.ViewModel = “models/PG_props/pg_weapons/pg_pickaxe_viewmodel.mdl”
SWEP.WorldModel = “models/PG_props/pg_weapons/pg_pickaxe_worldmodel.mdl”

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = “none”

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “none”

local ShootSound = Sound( “Metal.SawbladeStick” )

/---------------------------------------------------------
Reload does nothing
---------------------------------------------------------
/
function SWEP:Initialize()

self:SetWeaponHoldType( “meele” )

end

function SWEP:PrimaryAttack()

self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK)

end

function SWEP:Reload()

end

function SWEP:Deploy()

self:SetSkin(0)

end

SWEP.CanFire = 0

/---------------------------------------------------------
SecondaryAttack
---------------------------------------------------------
/
function SWEP:SecondaryAttack()

end
[/lua]

Init
[lua]
AddCSLuaFile( ‘cl_init.lua’ )

include( ‘shared.lua’ )

function SWEP:PrimaryAttack()

if self.CanFire > CurTime() then return end

ore = self.Owner:GetEyeTrace().Entity
eyetrace = self.Owner:GetEyeTrace().HitPos

for k,v in pairs(Ores) do

	if (ore:GetClass() == k) then
		
		if (self.Owner:GetPos():Distance(eyetrace ) < 125 ) then
			
		local actname = "mining"
		local acttime = 1
		local skin = ore:GetSkin()
		
			if (skin != 6) then

			DA_Mining(self.Owner,actname,acttime,skin,ore)
			
			end
	
		end
	
	end

end

self.CanFire = CurTime() + 1

end
[/lua]
Cl_Init
[lua]
include( ‘shared.lua’ )
[/lua]

[editline]27th March 2011[/editline]

I have it, the init part overwrite it, dunno how to fix xD

[editline]27th March 2011[/editline]

I have fixed it, thx

Thats, odd. Probably won’t matter but you could emit the animation on the server instead of shared, but that most likely won’t fix it.

:smiley: