Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My animation on my custom weapon doesn't seem to play, any help?

Asked by 6 years ago

I am trying to make a custom weapon for my game, and when i created my custom hammer, i attached a basic weapon attack mechanic script alongside my own animations, but it doesn't seem to play the animation on the hand with the tool on it (as if it makes my hand anchored in place as the other parts move). Does anyone know how to make it to where the weapon would follow my animation?

Here are some screenshots for reference How it is in game: https://gyazo.com/487dcd56c16c40c16d0f41ad8ed8446b

How the animation is suppose to be: https://gyazo.com/cff061f0d8c4baecd2824a33e69b1076

as you can see, the hammer doesn't seem to turn with the hand, but it is stiff and only rotated because of the torso.

Any help would be helpful for me :)

Here is the attack script used:

local canAttack = true

script.Parent.Equipped:connect(function()
    local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
    local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
    idle:play()
end)

script.Parent.Activated:connect(function()
    local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
    local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)

    if canAttack == true then
        attack:Play()
        idle:Stop()
        canAttack = false
        wait(1)
        attack:Stop()
        idle:play()
        canAttack = true
        script.Parent.CanDamage.Value = true
    end
end)
1
Does your weapon create a weld? If it does, remove it and test if the animation works hellmatic 1523 — 6y
0
^^ welds can stop your animation from playing. For example your script creates a weld grip with the tool handle and the player's right arm. When you play a animation that uses the right arm, the arm wont move. awesomeipod 607 — 6y

Answer this question