Motor6D scripting problem

Help with Motor6D script

I wanted to make gun stick to uppertorso but it dose not seem to work

My script `
local tool = script.Parent
local player = tool.Parent.Parent


local character = player.Character
tool.Equipped:Connect(function(Animpro)
	character.UpperTorso:WaitForChild("RightGrip"):Destroy()
	local Motor6D = Instance.new("Motor6D",character.UpperTorso)
	Motor6D.Name = "Engineers_RevolverMotor6D"
	Motor6D.Part0 = character.UpperTorso
	Motor6D.Part1 = tool.Handle
	Motor6D.C0 = CFrame.new(-0.1,-0.2,0.3)
	
	local Anim = Instance.new("Animation")
	Anim.AnimationId = "rbxassetid://8078765593"
	Animpro = character.Humanoid:LoadAnimation(Anim)
	Animpro:Play()

end)` But sadly it dose not work gun sticks to righthand and animation is not playing correct
image
Sorry for my English

You set the C0 using
Motor6D.C0 = CFrame.new(-0.1,-0.2,0.3)
but I can’t see anywhere that you set the Motor6D.C1.

You forgot to assign the C1 property of the Motor6D instance.

local character = player.Character
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://8078765593"
Animpro = character.Humanoid:LoadAnimation(Anim)

tool.Equipped:Connect(function(Animpro)
	character.UpperTorso:WaitForChild("RightGrip"):Destroy()
	local Motor6D = Instance.new("Motor6D")
	Motor6D.Parent = character.UpperTorso
	Motor6D.Name = "Engineers_RevolverMotor6D"
	Motor6D.Part0 = character.UpperTorso
	Motor6D.Part1 = tool.Handle
	Motor6D.C0 = CFrame.new(-0.1,-0.2,0.3)
	Motor6D.C1 = CFrame.new(0, 0, 0)
	Animpro:Play()
end)

Also avoid reloading the same animation (resulting in the repetitive creation of the same AnimationTrack instance) by moving the code which loads the animation outside of the function connected to the tool’s Equipped event, also you should avoid using the parent parameter of “Instance.new()” as it’s highly inefficient.