Animation for sword not working/glitching out

Hello, I’m currently trying to create a Roblox sword with swinging, but I’ve ran into a roadblock here as I’m don’t know how to resolve the issue of the handle not moving/turning like it does in the animation. I have provided images to show how the rig used/tool is rigged and structured. (I do not have an equip animation, and I am using a handle). Essentially when I try to activate the tool and play the swing animation the player character moves but not the actual sword, infact is glitches out (I’ve noticed it’s because of the motor6d). I’ve looked around dev forum for a solid hour but all the similar posts detail equip animations and not a swing animation, so any help would be greatly appreciated.


Screenshot 2024-08-25 202610
Screenshot 2024-08-25 202623
Screenshot 2024-08-25 202640

This is how the animation is supposed to look for example:

This is my code for the sword script:


local motor6d = Instance.new("Motor6D")

tool.Equipped:Connect(function(mouse)
	currenttrack = 1

	character = tool.Parent
	player = game:GetService("Players"):GetPlayerFromCharacter(character)

	motor6d.Parent = character["Right Arm"]
	motor6d.Part0 = character["Right Arm"]
	motor6d.Part1 = tool.Handle.BodyAttach
	humanoid = character:FindFirstChild("Humanoid") if not humanoid then return end
end)



tool.Activated:Connect(function()
	if debounce then return end
	if currenttrack == 5 then
		task.wait(config.cooldown)
		debounce = false
		currenttrack = 1
	end
	
	if not debounce then
		debounce = true
		if not humanoid then return end
		tool.Animations.BodyAttach.AnimationId = animationids[currenttrack]
		character["Right Arm"].RightGrip:Destroy()
		playingtrack = humanoid:LoadAnimation(tool.Animations.BodyAttach)
		currenttrack += 1
		playingtrack:Play()
		playingtrack.Ended:Wait()
		--[[if character["Right Arm"]:FindFirstChild("RightGrip") then
			character["Right Arm"].RightGrip.Enabled = true
		else return
		end]]--
		debounce = false
	end
end)

I’m sorry if this looks rushed, I’m really desperate for an answer since I’ve been on this for a while now, so any help of any kind would be appreciated.

1 Like

You sure you positioned the tool properly? If so, did you try different animation priorities?

1 Like

I’m very sure the tool is properly positioned, when the animation is playing the entire thing is staying still though so IDK, I’m going to try animation priority
EDIT: animation priority does not work

1 Like

I’ll try and think of something to help. Maybe your motor6d is funky

1 Like

Probably the motor6d, these are the motor6d properties when created:


The animation plays completely fine (just that the sword doesn’t move and is stuck in the vertical position) when the motor6d is removed, I don’t know why.

1 Like

Ok, I settled for an interesting fix, by redoing the animations in Moon Animator with the sword named handle, and it seemed to fix it.

1 Like

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