Sword Animation With Motor6D

Hi everyone,

I’m currently working on an attack animation involving a sword. The sword itself is part of the animation, so I attached a Motor6D to connect the sword’s Handle to the RightHand of the character’s rig. The animation plays perfectly in Roblox’s Animation Editor—the sword moves along with the rest of the rig. However, in-game, the sword does not move while the rest of the character’s rig animates correctly.

Here’s what I’ve done so far:

  1. Placed the sword inside the character’s model.
  2. Welded the sword to the character, then added a Motor6D between the RightHand and the sword’s Handle.
  3. Created the animation in the Animation Editor, ensuring the sword’s Handle was included in the movements.
  4. Set the animation’s priority to Action (Level 2).
  5. Uploaded the animation to Roblox and used the following script to test it in-game:
if input.KeyCode == Enum.KeyCode.F then
    InGameModule.TakeDrop(player)
    local animator = player.Character.Humanoid:FindFirstChild("Animator")
    if animator then
        local attackAnimation = Instance.new("Animation")
        attackAnimation.AnimationId = "rbxassetid://101610726264616"
        local attackTrack = animator:LoadAnimation(attackAnimation)
        
        attackTrack:Play()
    end
end

When I press F, the animation plays, but the sword remains static. Only the character’s rig animates as expected.

Additional Context:

  • None of the sword’s parts have Anchored or CanCollide enabled.
  • The Motor6D has a unique name and does not conflict with any other instances.
  • In the Animation Editor, the sword and character move perfectly in sync.

Below are demonstration videos:

  1. Expected behavior in the Animation Editor

  1. How it looks in-game

If anyone has experience with similar issues or needs further context, please let me know. This problem has me stuck, and I’d greatly appreciate any advice.

Thank you!

I would increase the animation priority, stop all playing tracks, and I want to confirm that the sword is just another joint. If it is a tool, there is a slightly different process(you can google articles, there are a lot).

I already stopped all the animations and gave it priority level 4, and it still remains the same, it is not a tool it is a part

The AnimationPriority has to be set inside of the script after the animation was loaded. I’ve also encountered this issue, and setting the AnimationPriority to Action4 in the script worked just fine.

I just tried it and nothing has changed.

Hey, if you’re creating the weapon and attaching it to the character on the server then the server has what is known as “Network Ownership” over those parts. Because the server owns those parts, even though they’re in your model and attached properly, your client still doesn’t have the authority to animate the Motor6D. It works in studio and your animation editor bc you rigged the editor in studio and studio play test has local ownership only.

If I’m right? Your best solution might be animating on the server, sorry.

Could you be more specific about Animating on the server?

Instead of loading and playing the animation in your localscript, instead send a remoteevent to the server which then loads and plays the animation.

However, you could try using what I found on this page about network ownership

In experiences with complex physics interactions or in cases where you need to assign direct control, you can set ownership through a server-side call to BasePart:SetNetworkOwner().

Maybe if you set your player to be the network owner of the primarypart of your weapon, your local animation will run.

Could you give me an example of how to use it, for example in this code:

local animator = player.Character.Humanoid:FindFirstChild("Animator")
local handleAnimation = player.Character.Sword.Handle
if animator then
	local attackAnimation = Instance.new("Animation")
	attackAnimation.AnimationId = "rbxassetid://101610726264616"
	local attackTrack = animator:LoadAnimation(attackAnimation)
	
	attackTrack:Play()
end

Does the Motor6D exist on the player character, and if so, look if it’s enabled and what its Part0 and Part1 are.

The different parts of the motor6d are enabled

Hi everyone, I have found the solution or rather the problem. It happened that I had a weld on the Handle with the RightHand and also the motor6d with the same 2 parts.

The solution was to remove the weld.