How to animate Tool Handles easily! [OLD POST]

Oh yeah I meant that my apologies. Was really late last night when I sent that reply. Please use StarterCharacterScripts

4 Likes

You cannot put the grouped bat model in the StarterPack. You only need the grouped bat model for when you animate with your dummy. The motor6D will apply the animations to you and your tool later on. You will need a Tool Object with a load animation script which I have provided in my idle animation fix.

2 Likes

Ok, thanks for the explanation. Just didn’t know where to put it all.

2 Likes

Also keep in mind, when you upload your animation when your done with the dummy, please put the Animation ID in the Animation objects “AnimationId” field in properties. This is because you need an Animation object to load an animation onto yourself and the tool. It doesn’t matter where you put it

1 Like

And where do I do that? In a animation object I add to the bat? What I have done is put the model in a tool object, then I put the load animation script in.

Edit: I also put it in starterpack.

Edit 2: Basically when it come’s to scripting I’m lost.

Here, let me provide a tree so you better understand, but I’ll explain quickly.

All you need to do is put the Tools Handle in a group INSIDE the dummy. Then, add a motor6D to that dummy, and set Part0 to the Right Arm (or RightHand) and set the Part1 to the tools handle. Now you will be able to animate the tool. Once you are done animating the dummy, and the tool, take the ID and put the ID in the Animation Object’s “AnimationId” field in properties. This is where your LoadAnimation script becomes useful, because you have to get the Animation, and play it on your character upon equip.

Keep in mind, you ONLY put a TOOL object inside StarterPack. Do not put the model inside StarterPack. That was only for the dummy.

Here’s an article that explains animating a tool with a dummy a little easier. It was already posted in the main tutorial, in case you had missed it.:

2 Likes

https://gyazo.com/cca487edfe6ef8b8874aea2ad97596b9

A pic of what I have done so far. I’m confused by the AnimationId part. I did everything you told me to. I put it in a tool and then put it in starterpack adding the loadanimation script to it and everything. I need to know what you mean by AnimationId. Is it in a script? Where do I add it?

Edit: I made both the Idle animation and the Swing animation. I have no idea on where to put it. I understand that I need to put it somewhere, but not WHERE.

Oh! I See the Issue! You put the grouped model inside the tool. Just ungroup the model inside the tool, so you have the handle a child of the Tool.

Edit Also Animation is an OBJECT. Click on “ServerStorage” and the + icon beside it. Type “Animation” and hit enter. It will add an Animation to ServerStorage. If you click on the newly created Animation, look at properties, and set the “AnimationId” to the ID of the uploaded animation.

1 Like

Thanks, it kinda worked. Now for the animation part. https://gyazo.com/86867b277bc3005f573bea03c97b8db8

1 Like

Make sure with your LoadAnimation script on this line:

script.Parent.Equipped:Connect(function()
	
	IdleRest = script.Parent.Parent.Humanoid:WaitForChild("Animator"):LoadAnimation(ChangeThisToThePathOfTheAnimationObject)
	-- Change "IdleRest" to the name of the variable you want to use

	IdleRest:Play() -- Then change IdleRest in here to the name of the new variable name
end)

Is changed to the path of the Animation Object. Since I told you to put it in ServerStorage, put game.ServerStorage.Animation right in the :LoadAnimation() bool.

1 Like

What if you have more animations? Do you just add another animation object? Is that all I have to do to make it show the animation?

Edit: I change the path and added the animation ID to the animation object. It still doesn’t show. Did I miss something?

Oh yeah this is perfectly fine. The code I just sent is only for your Idle animation of the tool so it doesn’t go in your arm.

You can do

script.Parent.Activated:Connect(function)
    -- Load your animation just like the idle animation
end

or

script.Parent.Deactivated:Connect(function)
    -- Load your animation just like the idle animation
end

There are other ways to cycle through different Idle Animations if that is what your asking, but I didn’t cover that in this tutorial because that isn’t something I’m skilled with.

FOR YOUR ISSUE

When animating, did you set the Animation Priority to Action? If you didn’t, then the animation will refuse to play.

1 Like

Let me check. I think I set it to idle, that might be the issue. Thanks!

1 Like

Still does the same. https://gyazo.com/a0c6c4971bea38060f03323e54d0b443

Can you send me what you have inside that Script of yours exactly? I feel like that could help me with this issue a bit further. The script is in charge of loading the animation, so it has to be something with the script.

1 Like

Let me try something, I think I got the problem.

1 Like

Okay. Keep me posted if any further issues seem to occur after your solution.

1 Like

IT WORKS. I’m so dumb that I forgot to change my avatar to R15. Thanks alot mate!

Ok so 1 last question. I want to add the swing. How.

script.Parent.Activated:Connect(function()
    -- Load your animation just like the idle animation
end

Put that code into the same script where you loaded your idle animation. Do not put this function inside the Equipped function. Keep both functions separated from each other. Just scroll down in the script (if your able to) and paste it down there.

MY BAD

Load your swing animation under the Equipped function, but add the :Play() to the activated function.

Example:

script.Parent.Equipped:Connect(function()
	
	IdleRest = script.Parent.Parent.Humanoid:WaitForChild("Animator"):LoadAnimation(game.ServerStorage.Animation)
	SwingAnimation = script.Parent.Parent.Humanoid:WaitForChild("Animator"):LoadAnimation(game.ServerStorage.SwingAnimation)


	IdleRest:Play()
-- Do not play the Swings animation here. You put that in the Activated function.
end)

script.Parent.Activated:Connect(function()
   SwingAnimation:Play()
end)
2 Likes