I’m trying to weld a part to a player, as I’m creating a skill for my game. However, when the part is welded (with a WeldConstraint) to the player’s right hand, the part makes the character not able to move. I know this is the behavior of welds, but I’d like to know if there’s a way of preventing the two parts from “blocking” each others. If anybody can help I’d appreciate it.
local Humanoid = Character.Humanoid;
local Animator = Humanoid:FindFirstChild("Animator") or Instance.new("Animator", Humanoid);
local RootPart = Character.HumanoidRootPart;
local Head = Character.Head;
local Torso Character:FindFirstChild("UpperTorso") or Character.Torso;
local Limb = Character:FindFirstChild("RightHand") or Character["Right Arm"];
local Track = Animator:LoadAnimation(script.Start);
Humanoid:SetAttribute("Block", false);
StuckBV.Parent = RootPart;
--| Checking if the rig is R15 or R6 + Playing track
if Humanoid.RigType == Enum.HumanoidRigType.R6 then
R15 = false;
Track = Animator:LoadAnimation(script.StartR6);
end;
Track:Play();
--| Blocking the player
Stuck.Parent = Character.Debounces;
Move.Parent = Character;
--| Creating the disk
local Disk = Assets.Disk:Clone();
Disk.Anchored = false;
Disk.CFrame = Limb.CFrame * CFrame.new(0, -Limb.Size.Y / 2 - 2, 0) * CFrame.Angles(math.rad(90), math.rad(90), 0);
Disk.Creator.Value = Character;
Disk.Parent = workspace.Effects;
--| Welding sphere to limb
local Weld = Instance.new("WeldConstraint");
Weld.Part0 = Disk;
Weld.Part1 = Limb;
Weld.Parent = Disk;
Weld.Enabled = true;
To answer that, no. Parenting the weld instance itself doesn’t change the properties of the weld. Weld constraint is harder to be broken than a manual weld, motor 6d, or any other types of welds.
Is the CanCollide property off? It might be a contributing factor.
To be honest if I were you, I’m more likely going to use a Motor 6D OR a manual weld over a weld constraint, and I would parent the disk itself to the character for stability.
have any BodyPosition or anything else in it? In the video it appears to want to stay at the same Position, like being Anchored, but it also seems to be tilting slightly with the arm animation?
Have you tried making it Massless? That can affect welding Parts to a player as well.
Didn’t work, but it helped as the character didn’t glitch anymore. But anyways I tried what @Jas_nRuski and
apparently it was the solution. Didn’t think anything would’ve changed honestly, except stability as he said, but it did, so thanks for the help to you and everyone who answered this post.
For future reference, you really want to consider using a tool for anything that includes a part. In this case, if a disk is welded to a hand, you might just consider using a tool for it.
This eventually comes down to Network Ownership (example 3). When you welded the part to client, the server resumes having ownership of the part, therefore a player can’t control it. Typically you would call some complex functions to set the network ownership to client, but in this case, the easiest way out is just to literally parent it.
Well I use tools to control the moves, however, they have separate ModuleScripts that actually control the moves. I might consider switching if I encounter another big problem. And I didn’t know about that Network Ownership thing too, I only thought it wouldn’t work with welded parts BUT welded to an anchored part, which is not the case here. Thanks for the clarifications!