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