Hey guys! im currenlty working on my game, but the mortor6d welding is a bit eh. Here is the code what happens is when you die sometimes it just half welds and gets stuck in your head like this.

Here is the code:
Server:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local a = Instance.new("Motor6D")
a.Parent = char.Torso
a.Part0 = char.Torso
a.Name = "ToolGrip"
end)
end)
game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr,location)
local char = plr.Character
char.Torso.ToolGrip.Part0 = char.Torso
char.Torso.ToolGrip.Part1 = location
end)
game.ReplicatedStorage.DisconnectM6D.OnServerEvent:Connect(function(plr)
plr.Character.Torso.ToolGrip.Part1 = nil
end)
In local script in the tool
Gun.Equipped:Connect(function()
char.Torso:WaitForChild("Motor6D").Part1 = Gun.MainPart
end)
script.Parent.Equipped:Connect(function()
game.ReplicatedStorage.ConnectM6D:FireServer(Gun.MainPart)
char.Torso.ToolGrip.Part0 = char.Torso
char.Torso.ToolGrip.Part1 = Gun.MainPart
end)
Gun.Unequipped:Connect(function()
game.ReplicatedStorage.DisconnectM6D:FireServer()
end)
any help loved
You haven’t set a C0 or C1 value. The C0 is the central connection point (in motors, hinges) point of rotation. C1 is the offset from C0.
You should probably be welding Part0 as the right arm and setting C0 to a CFrame that is a few studs forward so that it appears in the hand. If the Motor6D doesn’t need to rotate, then you can ignore C1 for now.
This isn’t my problem, it workls perfectily fine, but when you die it’s 50% chance, of it getting half welded, example in the photo above, it gets welded, half way, but stops.
I’m confused how you expect to get the consistent results if you’re not accurately setting the Weld’s offset.
If it “works perfectly fine” but 50% of the time, then it doesn’t work right.
Hello there (lol). The actual Motor6D is there; the fact that it’s welded into your head simply shows that the Motor6D is in the Parent. It may be potentially that an animation simply isn’t running.
One inconsistency I notice is this;
Gun.Equipped:Connect(function() char.Torso:WaitForChild("Motor6D").Part1 = Gun.MainPart end)
It’s waiting for a Motor6D named “Motor6D”, however earlier you made a Motor6D and named it “ToolGrip”, if that has anything to do with it, that is.
Yea I solved this two days ago, the problem was that the Mortor6d was called “ToolGrip” the normal tool welding is called ToolGrip, and for somereason this would create a weld sometimes instead of a mortor6d, i’ve seen to fix to problem now thx tho