Motor6d Weapon Animations Acting Weird

Problem
Alright, so lately I’ve been making a game using animations and motor6ds to rig and animate weapons. I animated the weapon successfully, but when I rig it in a script it appears strangely.

The idle animation is meant to look like this:
dummyidle

But instead it looks like this:
weapon

How do I fix this so the weapon is in the correct position? I’ve already done all the animations I’ve had to, and I hope I don’t need to restart 4 hours of work just for a studio bug.

Code

--//VARIABLES\\--
--|SERVICES|--
local storage = game:GetService("ServerStorage")
local players = game:GetService("Players")
local replicated = game:GetService("ReplicatedStorage")
--|FOLDERS|--
local weapons = storage:WaitForChild("Weapons")
local animations = storage:WaitForChild("Animations")
--|DIRECTORIES|--
local sekiroweapons = weapons:WaitForChild("Sekiro")
local sekiroanims = animations:WaitForChild("Sekiro")
--//MODULE\\--
players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char)
		--//VARIABLES\\--
		--|BODY|--
		local root = char:WaitForChild("HumanoidRootPart")
		local torso = char:WaitForChild("Torso")
		local rarm = char:WaitForChild("Right Arm")
		--|WEAPONS|--
		local katana = sekiroweapons:WaitForChild("Katana")
		--|SCRIPTS|--
		local animate = char:WaitForChild("Animate")
		--|POSES|--
		local run = animate:WaitForChild("run"):WaitForChild("RunAnim")
		local walk = animate:WaitForChild("walk"):WaitForChild("WalkAnim")
		local idle1 = animate:WaitForChild("idle"):WaitForChild("Animation1")
		local idle2 = animate:WaitForChild("idle"):WaitForChild("Animation2")
		local jump = animate:WaitForChild("jump"):WaitForChild("JumpAnim")
		local fall = animate:WaitForChild("fall"):WaitForChild("FallAnim")
		--//MODULE\\--
		local weapon = katana:Clone()
		weapon.Parent = char
		local motor = Instance.new("Motor6D")
		motor.Parent = rarm
		motor.Name = "Weapon"
		motor.Part0 = rarm
		motor.Part1 = weapon:WaitForChild("Frame")
		run.AnimationId = sekiroanims:WaitForChild("Walk").AnimationId
		walk.AnimationId = sekiroanims:WaitForChild("Walk").AnimationId
		idle1.AnimationId = sekiroanims:WaitForChild("Idle").AnimationId
		idle2.AnimationId = sekiroanims:WaitForChild("Idle").AnimationId
	end)
end)

Any answers would be appreciated.

2 Likes

The animation even works properly when played on the dummy in game using a script.
played

is the weapon a tool? #30characterlimit

No, the weapon is rigged to the character with a motor6d when they spawn in.

--try rearranging you code where the motor is to this:
--make these lines:
local motor = Instance.new("Motor6D")
motor.Parent = rarm
motor.Name = "Weapon"
motor.Part0 = rarm
motor.Part1 = weapon:WaitForChild("Frame")

--this
local motor = Instance.new("Motor6D")
motor.Name = "Weapon"
motor.Part0 = rarm
motor.Part1 = weapon:WaitForChild("Frame")
motor.Parent = rarm

I tried it and it ended up having no effect at all.

if you wouldnt mind sharing a place file I might can fix it.

Sorry but I have some meshes there I’d like to keep private, can you try doing it based on the code? I can send what the weapon looks like as well.
frame

How do you weld the tool to the animating dummy with Motor6D at the first place? Do you use a plugin or manually weld it?

I manually added a motor6d into the right arm of the dummy, connecting it to the frame; the main part of the weapon. Isn’t this the exact same thing I did with the script?

For tools what I do is have a motor6D already in the tool with the Part1 set as the handle or whatever already.

When the tool is equipped the Part0 is set to the Right Arm and nothing else has to be changed.

1 Like

For some reason, when I clone the motor6d inside the dummy and place it in Serverstorage and use it as the motor like this:

local motor = storage:WaitForChild("Attach"):Clone()
motor.Parent = rarm
motor.Name = "Weapon"
motor.Part0 = rarm
motor.Part1 = weapon:WaitForChild("Frame")

It works perfectly fine when I do this.

This is because the Motor6Ds in dummies are not default Motor6Ds, they have C0 and C1 properties that you cannot view in the properties panel. You can make a brand new Motor6D when rigging the dummy (Instance.new("Motor6D", workspace) in console) or you can copy the Motor6D you use directly from the dummy via the script. I personally do the second option, however it’s up to you.

2 Likes

Try messing with the

Motor6d.Transform

property

Keep in mind this property does not replicate across the client-server boundary

1 Like

Check the animation priority. It’s set to ‘Core’ by default, and if you haven’t changed it then the default idle animation will layer on top of it weirdly.

4 Likes

Yes, you’re right. @Stealthied Did you create a new Motor when animating the Dummy? Or just copy and pasted an existing one inside the Dummy such as Left Shoulder? Since it works when you copy and paste the Motor6D inside the dummy but not by creating a new one. as fireboltofdeath said, the Motor6Ds inside the dummy (Left Shoulder, Right Shoulder etc.) have a different C0 and C1, they can both result your tool offsetting from your arm.

1 Like

I think I copied an existing one from inside the dummy and changed its properties from what I remember. Well, it may be a choppy method to use a cloned version of a dummy’s motor6d but it definitely works 100 times better than creating a new one, and is easier.

Does it solve the problem? And also what properties did you change? Did you include C0 and C1?

Yes, it solves the problem. I didn’t really change anything, I even used the C0 and C1 I used for the original.