HingeConstraint not activating

Usually, a HingeConstraint would activate (Active = true) when it’s Enabled and the 2 parts are in Workspace. However, mine doesn’t activate at all. I did pretty much everything I said at the beginning. Here’s a snippet of my code if it helps.

    local ROTATE = script.Parent
    local objects = ROTATE:WaitForChild('Objects')
	local base = objects.A.PrimaryPart

	-- constructing the hinge
	local hingePart = Instance.new('Part')
	hingePart.Transparency = .5
	hingePart.Anchored = true
	hingePart.CanCollide = false
	hingePart.Position = base.Position
	hingePart.Parent = objects
	hingePart.Rotation = Vector3.new(0,0,90)
	
	
	local attB = Instance.new('Attachment')
	attB.Parent = hingePart
	local hingeConstraint = base:WaitForChild('HingeConstraint')
	hingeConstraint.Attachment1 = attB
	hingeConstraint.Parent = base

image

Make sure that only one part in the assembly (or none) are anchored. I also think that the constraint has to be parented to the part that Attachment0 belongs to but that may just be WeldConstraints.

3 Likes

Ahhh, I should’ve noticed that. I only had to remove the line that anchors the hingePart. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.