Animation half not working

I want this animation to look like the video provided of the completed animation. This is an equip animation for a tool I plan to use in my game.

image

image

The top video (or the one that looks right) is what I want, but for some reason the animation works for the character, but not the shovel, and I’m confused.

I’ve tried everything, but I’ve been pulling out my hair because for the life of me, I cannot figure out what is wrong, maybe it’s a silly mistake or I’m stupid, but I’ve tried everything, I have spent hours searching the Forum to anything relating to my issue, but to no avail, I am questioning either its something I did wrong or its a Roblox related issue. I have already set the animation priority to Movement, Action, actually I have tried all the priority’s, I’ve tried welds, motor6d, changing how the script receives the animation but nothing has worked. I honestly don’t know what to do, but this is my last ditch effort to fixing this issue. Sorry for the yap, but I pray someone can help me.

The Equip Script (Local Script)

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://94035431726343" 


local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")


local animTrack = humanoid:LoadAnimation(anim)


script.Parent.Equipped:Connect(function()
	animTrack:Play()  
end)


script.Parent.Unequipped:Connect(function()
	animTrack:Stop() 
end)

The attach script (Server script)

(also because I use a part instead of a handle, this is where I originally got it from: How to animate Tool Parts (Guns, Knifes etc.) - #5 by ap_ek )

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		
		local M6D = char:FindFirstChild("ToolGrip") or Instance.new("Motor6D")
		M6D.Name = "ToolGrip"
		M6D.Part0 = char:FindFirstChild("RightArm") 
		M6D.Parent = char

		
		local function onToolAdded(child)
			if child:IsA("Tool") and child:FindFirstChild("BodyAttach") then
				M6D.Part1 = child.BodyAttach
			end
		end

		
		char.ChildAdded:Connect(onToolAdded)

		
		for _, child in ipairs(char:GetChildren()) do
			onToolAdded(child)
		end
	end)
end)
1 Like

I’m having the same issue. While I was trying to fix it, the Motor6D isn’t placed correctly, & the RightWeld (the weld that spawns when you equip something) is preventing it from being animated. Try to destroy the weld, I’m still new & don’t know how to script. If you do manage to solve it, please send me the script. Thank you.

I figured this out a couple days ago. It was the tool having a part named “Handle” which caused it to not animate. I fixed it but if you implement this, you might need to add a CFrame for the animation to start on or else it might not work. Thank you for the help!

name the handle of the tool something besides handle and set the HandleRequired of the tool to false and then set the motor6d’s part0 whenever it is equipped

It worked! Thanks for your help! (sorry for the 2 deleted messages, my wi-fi hates me)

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