Motor6D not functioning as intended

I’m trying to animate my weapons, and have spent all day on this with no luck. I have some animations which work fine in the animation editor. They’re connected up with a Motor6D (Part0 is right arm, part1 is the WeaponAttach)

However, when I test the game, the animation works, but the bat is in the wrong place.

Editor:
image

In Game:
image

Tool is in starterpack currently.

Server:

script.Parent.ConnectMotor.OnServerEvent:Connect(function(plr,bodyAttach)
	local motor = Instance.new("Motor6D",plr.Character:WaitForChild("Right Arm"))
	motor.Name = "ToolGrip"
	motor.Part0 = plr.Character["Right Arm"]
	motor.Part1 = bodyAttach
	motor.Parent = plr.Character["Right Arm"]
end)

script.Parent.DisconnectMotor.OnServerEvent:Connect(function(plr)
	plr.Character["Right Arm"].ToolGrip:Destroy()
end)

Client:

local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local anim
local tool = script.Parent


script.Parent.Equipped:Connect(function()

	script.Parent.ConnectMotor:FireServer(tool.BodyAttach)

	anim = char.Humanoid:LoadAnimation(script.Animation)
	anim:Play()

end)

script.Parent.Unequipped:Connect(function()

	script.Parent.DisconnectMotor:FireServer()
	anim:Stop()

end)

I appreciate help!

1 Like

Are you using a plugin to make the motor6D for making the animation?

1 Like

Yes, I’m using Moon Animator…

No i mean a plugin to create the motor6Ds like this one (Constraint Editor - Roblox) are you using any ?

My friend made the animation, not me. I asked him and he has no idea.

But most likely, yes.

i think i know whats happening then:

when you are creating the Motor6D normaly part1 position will be relative to the part0 so its position will be reset thats why there is C0 and C1 and when making it in the plugin its position will not change but still relative to part0 so whats happening is that in the script its creating the motor6D and its position is reset but in your animator the motor6D position havnt reset(if you are not understanding it tell me because its hard to describe it).

so to fix it all you have to do is create the motor6D yourself and put it in the dummy and set part1 and part0 and you will notice the bat position will change which is good then re animate it.

No, I didn’t use the Constraint Editor and stuff. Only Moon Animator

When you animate the tool in game, it won’t animate unless you attach the motor6d to the arm using a script. I made an entire tutorial right here on the developer forum. It’s a bit long, but it should help you.

I just noticed that you made your own script and it could be debugged, but my tutorial can help you avoid RemoteEvents, which also gets rid of a known exploit that Headstackk caused (no blame, just stating the facts, they said it themselves.)