Problem with using motor6D

Im trying to make a gun system using motor6D’s instead of handles because of the animations and stuff im going to do with a Z-6 (Minigun from SW). Anyways whats happening is when i equip it, it does this weird bug when switching it to the animation i dont know how to fix this problem i even tried changing part1 on the client and server (Did both at once to see if changing it on the client would be faster) but that doesnt work.

Clip of whats happening

The script part


--- When the Player joins the game i add it to the upperTorso because created it over and over again can make the glitch happen worse
game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Char)
        local A1 = Instance.new("Motor6D") -- Reason why its A1 is could im gonna make a second one for a dual pistol in the future
        A1.Parent = Char.UpperTorso
        A1.Part0 = Char.UpperTorso
        A1.Name = "BodyAttach"
    end)
end)

--- Where it equips (I am also wondering if using a remoteFunction could make it a little faster)
Remotes.attachGrip.OnServerEvent:Connect(function(Player, BodyAttach)
    local Char = Player.Character
    local attch = Char.UpperTorso.BodyAttach
    attach.Part1 = BodyAttach
end)

Could you send your local script? I think the problem is when your tool equips, the weapon spawns and then gets put in the place, so it’s probably to do with the remote event placement.


function CheckWeapon(self, child)
    if child:IsA("Tool") then
        if not child:FindFirstChild("Emitter") then
            self.Hum:UnequipTools()
            return
        end

        if child:FindFirstChild("BodyAttach") then
            self.BodyAttach = child.BodyAttach
            Remotes.attachGrip:FireServer(child.BodyAttach)
        else
            self.Hum:UnequipTools()
            return
        end

        self.WeaponModel = child

        self:Equip()
    end
end

sorry for the late response ive been doing stuff

I still need help with this just bumping it up again !

I’m not 100% sure of the problem since everything looks fine, but maybe try switching the these 2 lines?

Remotes.attachGrip:FireServer(child.BodyAttach)
self.BodyAttach = child.BodyAttach 
-- Switched

It appears to me as if there’s a delay to when the BodyAttach is getting set, however I could be wrong since I’m not very proficient in animations.

I actually “fixed it” all i did was change the motor6D to the RightHand which “fixed” it !