How to hold gear with two hands?

Is there a way to hold gear with two hands? I dont have any idea how.

1 Like

You would need to make an animation with the animation priority set to Action.

3 Likes

i did what shall i do now?

Make sure it’s looped, and play it once you equip the tool using Humanoid:LoadAnimation().

i dont know how iam gonna play it

It would look something like this:

local Tool = script.Parent
local Animation = Tool.Animation
local AnimationTrack

Tool.Equipped:Connect(function()
AnimationTrack = Tool.Parent.Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
end)

Tool.Unequipped:Connect(function()
if AnimationTrack then AnimationTrack:Stop() end
end)

Devforum won’t let me indent, sadly…

You don’t have to loop it. You can just pause it after around 0.1 seconds, then when it’s unequipped, stop the animation.

More here: AnimationTrack | Documentation - Roblox Creator Hub

dont work

Check the output for error(s). I can’t see anything wrong with the code I provided, so it’s unlikely to be that. Make sure your animation has at least two keyframes at different times in total.

1 Like

[19:38:16.351 - Animation is not a valid member of Tool]

1 Like

Yeah simply switch out this line with:
local Animation = Tool:WaitForChild("Animation")

1 Like

It works! thanks so much! sorry for wasting your time

As long as I was helpful to you, my time was not wasted. :slight_smile:

9 Likes

Does your hand go up when walking? Mine does and I can’t seem to fix it.

1 Like

This happens because you don’t have a keyframe for the hand.

To overwrite joints each joint will need respective keyframes as well as be part of an animation with a higher animation priority than the other ones playing (e.g. core animations such as walking, idling, jumping, etc.)

The “action” animation priorities (1 through 4) are usually safe to use in order to overwrite these animations.

1 Like

Wouldn’t it be more optimal to state “AnimationTrack.Looped=true”?

1 Like