Hinge constraints not working as intended

Hi so I am currently trying to make a free-rolling ball teleport to a location and then anchor the bottom part of the ball. This works, however the ball is split in 2 and has a hinge constraint that will open or close the ball when i click it.

The issue that I am having is that as soon as the ball teleports and anchors the bottom part of the ball (the part that is usually anchored and is not meant to move) the hinge stops working until I unanchor the bottom part of the ball, however when i reanchor the bottom part after the hinge will continue to work.

Is there something that i am doing wrong or is this just an issue with hinge constraints. If it is the latter what can I do to prevent the issue from happening when the ball teleports and i want it to remain in the 1 location.

This is the script in the part that the ball will touch to be teleported. (This part works and the hinge will continue to work without the anchor part of the script)

local tppart = script.Parent
local tploc = tppart.Parent.TpLoc

tppart.Touched:Connect(function(otherPart)
	local character = otherPart.Parent
	if character:IsA("Model") and character.Name == "CashBall" then
		local CashBall = character -- Get the specific CashBall that touched the tppart

		-- Teleport the CashBall model to the location of tploc
		CashBall:SetPrimaryPartCFrame(CFrame.new(tploc.Position))

		-- Find and anchor the bottom part of the CashBall
		local bottomPart = CashBall:FindFirstChild("Bottom")
		if bottomPart then
			bottomPart.Anchored = true
		end
	end
end)

Video to better show what I mean (its really low quality)

(in the video I manually unanchor the bottom part of the ball and then reanchor it before i click it and the hindge works as intended)

Any help would be greatly appreciated

Try using a servo hinge instead and have the target angle to be the amount of degrees for it to be open

Thats what I have, when I click it the target angle will either be 0 (closed) or 90 (open). This works with all the other balls, however when this ball teleports and I anchor the bottom part (which is normally anchored unless i want the ball to free roll) the hinge wont work unless I unanchor it and reanchor it.

From my understanding it has something to do with the movement of the ball when it is anchored as when the ball is completely still and I anchor it, it works fine.

Anyone looking for the solution, the ball with the hinge has to come to a complete stop before it gets anchored, so once the ball touches the part i put a wait command in before the ball teleports and the issue has gone away.

Appears hinges dont function properly if the part they are attached do has momentum stored when they become anchored.

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