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.
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.