Properly equipping weapons and having them positioned correctly?

I have a function that equips the necessary accessories for the class the player selected at the moment it’s just a weapon which is a model.

local function equipClassAccessories(character : Model,className : string)
	local classAccessories = ReplicatedStorage.Client.Classes[className]:FindFirstChild("Accessories")
	
	if not classAccessories then 
		warn(className,"does not have a cosmetic folder") 
		return 
	end 
	
	local weapon = Util:FindFirstChildWithTag(classAccessories,"Weapon"):Clone()
	local rightArm = character:WaitForChild("Right Arm")
	local motor6D = Instance.new("Motor6D")
	
	weapon.Parent = character
	
	motor6D.Parent = rightArm
	motor6D.Part0 = rightArm
	motor6D.Part1 = weapon.Handle
end

The only thing I’ve learned that seems to be necessary is using a Motor6D since afaik that’s what lets the model work with the animation because a Motor6D can spin. With some animations and weapons though I’ve ran into a problem with the positioning being incorrect like this.