Animation not working correctly?!

Can you clearly tell me what to do in order cause this topic really is a chaos right now.

I don’t know how your exact model hierarchy is, so I can’t essentially type a script that you just plug it in and it works. It seems that you have a bit of tinkering with CFrames to do especially the attachments ones. I could help you with it if you send me a copy of the animation and sword model though. (You can dm me on Discord: temrer1247 or just dm me here, however you like more) hope this helps :slight_smile:

I’ve got a definitive solution a while ago, sorry for not replying. Still up?

Yes the problem is still there do you mind tell me the solution?

Alright, so if you or anyone is still wondering what’s the solution i’ll post it here.
First of all, delete both this LocalScript that requires the ModuleScript and the ModuleScript.

Now, we will start everything from the very beggining.

Some Explanation

I did a simple tool here in a completely blank Baseplate map to show you what happens when you just name the Grip (Blue Square) as “Handle”.


As you can see, when you name a Part as “Handle” in a tool Roblox automatically creates a Weld instance inside the Character’s RightHand to attach it to the player and also runs the default tool animation. To fix that, first we need to make sure the “RequiresHandle” option of the tool is DISABLED. What it does is basically allow you to create a Tool with or without the “Handle” BasePart. And then we rename the “Handle” Part to anything but “Handle”, so you can rename it to “ToolGrip” (Do not rename it to “Grip”). Also, the big part is at the ground because i didn’t Welded the ToolGrip to it.

Solution
1. Welding the "Handle" to the Sword's Model


What i recommend you to do here is, if you have only a single part/Mesh as the sword’s model, make a “Motor6D” instance to weld them cause the parts will remain at the same place. If you have a whole model to Weld, you can perfectly use Welds for every model’s part. You can have the help of some plugin if there’s too many parts. BUT the Part0 of all the Welds needs to be the “ToolGrip”, this is very important, also if you’re going to use the Motor6D.

2. Creating the Custom Hold Animation

As you already saw at the first step, there is no tool’s default animation playing. So now we can freely put our custom animation in there. (Sorry, but i will not explain how to make an animation)


I made this simple keyframe as the animation that only changes the Arm’s positions, but if you want you can change the sword’s position with a new Motor6D!

You know, Part0 is the Rig’s RightHand and the Part1 is the Sword’s ToolGrip just like we will make at the scripting step.
STEP10 V2
Don’t forget to Change the animation’s Priority to Action or above! Now you just publish it to Roblox (Also not showing this).

3. Loading the animation and Scripting (END)

Finally, we will load the animation when the Character equips the tool. Not something too complicated, so let’s script:

  • Copy the ID of the custom animation
  • Make an Animation instance and put it inside a folder named “Animations” to make it organized.
  • Paste the animation’s ID at the area i mentioned at the image. You don’t need to add the base URL, just paste the ID and it will put the URL automatically.
  • Create a RemoteEvent instance in your tool
  • Paste the following scripts:

LocalScript:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local tool = script.Parent

local EquipRemote = tool:WaitForChild("EquipRemote")
local Animation = tool.Animations.Animation
local AnimationLoad = animator:LoadAnimation(Animation)

tool.Equipped:Connect(function()
	AnimationLoad.Priority = Enum.AnimationPriority.Action
	AnimationLoad.Looped = true
	AnimationLoad:Play()

	EquipRemote:FireServer()
end)

tool.Unequipped:Connect(function()
	AnimationLoad:Stop()
end)

Script:

local tool = script.Parent
local EquipRemote = tool:WaitForChild("EquipRemote")

EquipRemote.OnServerEvent:Connect(function(player)
	local M6D = tool:WaitForChild("Motor6D")
	M6D.Part0 = player.Character:WaitForChild("RightHand")
	M6D.Part1 = tool.ToolGrip
end)

DON’T FORGET TO CHANGE THE SCRIPT’S LOGIC BASED ON THE INSTANCE’S NAMES AND WHERE YOU PUT THEM!

If you did everything correctly, you should be done. That’s it. Hope this helped! Results:


Also replicating to the server :point_up_2:

1 Like

I did everything exactly how you said it:

But it did not worked

here is a vid:

robloxapp-20230706-2005132.wmv (419.4 KB)

And here is my explorer with everything unfolded:

1 Like

Nothing at the output? If there is nothing, then there is something else at probably your animations keyframes or there is some script at probably StarterCharacterScripts that is making the animation like that. You can see that the custom animation is playing, so my system is working. Check your animation first. Even if you didn’t changed the position of the lowertorso nor the uppertorso, roblox will count it as static if there is a keyframe. Look at the pictures i sent you:

As you can see, when i moved the ToolGrip a keyframe was automatically created. Even if i put it back at the same position from before the Keyframe will remain there. This also happens with the RightUpperArm and the RightLowerArm, it remains static when you equip the tool as you can see. This means that if you made a Keyframe with the LowerTorso and your UpperTorso at the animation it will remain static cause this is the keyframe you made.

1 Like

I also recommend you to make a Motor6D when remake the animation and put the weapon at the correct side.

1 Like

You just have to add a local script so you can change the CFrame of the sword

it will look something like this:

Motor6D.C1 = Motor6D.C1 * CFrame.Angles(math.pi/2, 0, 0) * CFrame.new(0,.2,0)
--the CFrame.Angles will rotate the sword
--and the last CFrame will offset the sword so that it 
--won't clip in the player's hands

Hope this helps :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.