Motor6d problem

Im trying to animate my weapon, it works perfectly on dummy but not on players, there is the problem:
Player: Player
Npc: Npc

and here is my localscript:

  local function setUp(char)
        local handle = rs.Weapon.Handle:Clone()
        handle.Parent = char
        local m6d = Instance.new("Motor6D", handle)
        m6d.Part0 = char["Right Arm"]
        m6d.Part1 = handle
        m6d.C1 = CFrame.new(0,1,0)
  end

Edit: I switched from m6d.c1 to m6d.c0 and its working now

1 Like

When you equip a tool, there is a weld which welds the Right Arm (R5) or RightHand (R16) to the tool, You can use the parameters of the weld for the M6D, and then break it after your done. Here is an example:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEventsFolder = ReplicatedStorage:WaitForChild("RemoteEvents")
local Init_M6D = RemoteEventsFolder:WaitForChild("Init_M6D")
local Destroy_M6D = RemoteEventsFolder:WaitForChild("Destroy_M6D")

local function Init(player)
	
	local char = player.Character
	local a = char:FindFirstChild("Right Arm"):WaitForChild("RightGrip")
	local m6d = Instance.new("Motor6D")
	m6d.Parent = char:FindFirstChild("Right Arm")
	m6d.Name = "RightGrip"
	m6d.Part0 = a.Part0
	m6d.Part1 = a.Part1
	m6d.C0 = a.C0
	m6d.C1 = a.C1
	a:Destroy()
	return m6d
	
end

Init_M6D.OnServerInvoke = Init

Destroy_M6D.OnServerEvent:Connect(function(player, M6D)
	
	M6D:Destroy()
	
end)
2 Likes

But my weapon is not a tool its just welded to right arm

I cant seem to see the videos, mabye the link is broken

its working for sure for others, idk

remove this

Also make sure you destroy the grip weld
(29 letters limit)

1 Like

its almost like npc but katana is in the arm now instead of being held, how can i fix it?

You have to offset C0 and C1 to make
It holdable

Im having a similiar problem where my sword animations are not playing how it’s suppose to. I did my motor6d similiar to his. What did i do wrong??

Video:

function setup(Character)
	
	
	local handle = ReplicatedStorage.CombatFolder.Sword.Fx.Handle:Clone()
	handle.Parent = Character
	local Motor6d = Instance.new("Motor6D", Character["Right Arm"])
	Motor6d.Part0 = Character["Right Arm"]
	Motor6d.Part1 = handle
	handle.CFrame = Character["Right Arm"].CFrame * CFrame.new()
	Motor6d.C1 = CFrame.new(0, 1, 0 ) -- Changes the position/Offset of the sword on the Arm
	
	
end```