In order to have the Motor6D of the wooden stick be in the position and orientation as the RightGrip, i.e. the one seen in the Tool Grip Editor plugin, I changed its C0 and C1 values as shown in the script below. However, it also changes the position of the Hit Animation. I tried repositioning the Motor6D positions of C0 and C1 to CFrame.new() in the Activated event function, but it still won’t work. Although, it does work if I create an Idle animation, but I don’t want to use this method because it also overrides the existing walking animation. Is there a way to make the animation run as shown in the first GIF?
The Animation Priority is set to Action.
Expected Animation:
Bad Animation:
File Explorer:
LocalScript:
local player = game:GetService("Players").LocalPlayer
local char = player.Character
local tool = script.Parent
local anims = {script.Parent.Hit}
local animator
local loadedAnims = {}
local debounce = true
local cooldown = 2
tool.Equipped:Connect(function()
local Motor6D = Instance.new('Motor6D')
local RightGrip = char.RightHand:WaitForChild("RightGrip")
RightGrip:Destroy()
Motor6D.Name = "HandleMotor6D"
Motor6D.Part0 = char.RightHand
Motor6D.Part1 = tool.Handle
Motor6D.C0 = RightGrip.C0
Motor6D.C1 = RightGrip.C1
Motor6D.Parent = char.RightHand
end)
tool.Activated:Connect(function()
if debounce then
debounce = false
animator = player.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
if not loadedAnims[1] then
loadedAnims[1] = animator:LoadAnimation(anims[1])
end
loadedAnims[1]:Play()
wait(cooldown)
debounce = true
end
end)