Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I stop the player from spinning uncontrollable when I edit the C0 of a weld in the character?

I'm welding a part to the player (specifically, the HumanoidRootPart) and whenever I set the angle the player will spin uncontrollably. The player will stop spinning if I remove the Humanoid instance from the character, if that helps.

This is how I'm welding the parts together:

	local w = Instance.new("Weld") 
	w.Name = "cull"
	w.Parent = cullBox --the part that is being welded to the character.
	w.Part0 = player.Character.HumanoidRootPart --I've tried welding to other parts in the model, such as the torso, but the player still spins.
	w.Part1 = cullBox
	w.C0 = CFrame.Angles(0, 0, math.rad(-90)) --omitting this portion stops the spinning, but the part is oriented incorrectly
	w.C0 = w.C0 + Vector3.new(0, -1.3, 0)

2 comments

0

is the Part directly touching the player

0

The part is directly in/around the player. The player has been stripped of everything except its head, torso, and humanoidrootpart.

2 answers

The Part0 of a weld must be the same as the Parent. Just switch the Part0 and the Part1, and it should work.

local w = Instance.new("Weld") 
w.Name = "cull"
w.Parent = cullBox 
w.Part1 = player.Character.HumanoidRootPart 
w.Part0 = cullBox
w.C0 = CFrame.Angles(0, 0, math.rad(-90))
w.C0 = w.C0 + Vector3.new(0, -1.3, 0)

2 comments

0

Does not work, sorry.

0

Is the CanCollide property of the object true? If it is, then it may be touching the character in unpreferable ways and causing it to act weirdly.

I managed to solve my issue!

To whoever might find it useful, do not attempt to weld parts to the character (and if you have to, don't edit the CFrame angles) if you are relying on the built-in "StarterCharacter" functionality of StarterPlayer.

From now on I'll be instead generating the character via script.

This discussion is preserved as it was. New answers, comments, and votes are closed.