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

Part is still floating in the air when i destroy weld?

So basically when i destroy the weld the part is still floating if your standing still i really need this fixed i tried using tools but of course you cant click click detectors while using them thanks!

Maybe i can use something like a hinge or a rope as a replacement? Hmm..

My current solution is to make the part teleport to the ground under the player which is very unrealistic ;'/

workspace.part.click.MouseClick:Connect(function(plr)
local w = Instance.new("Weld")
w.Part0 = workspace.part
w.Part1 = plr.Character.RightHand
w.Parent = workspace.part
j = plr.Character.Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
j:Disconnect()
w:Destroy()
end)
end)

2 comments

0

I'm not sure but it can maybe be anchored

0

no it isn't anchored i've restorted to using hinges they work fine but very glitchy ;'/

2 answers

✓ Accepted answer
workspace.part.click.MouseClick:Connect(function(plr)
local w = Instance.new("Weld")
w.Part0 = workspace.part
w.Part1 = plr.Character.RightHand
w.Parent = workspace.part
j = plr.Character.Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
workspace.part:BreakJoints() -- breaks all it's joints/attachments etc
end)
end)

Just use the BreakJoints() thing (I don't know what you call them).

If this helped please accept this answer.

All the best,

PrismaticFruits

1 comment

0

Here is the document that I just found https://developer.roblox.com/en-us/api-reference/function/Model/BreakJoints. Hope it help you better understand.

If it's a Roblox bug, you could "awaken" the part by adding a very small amount of Velocity to it (this will effectively "remind" Roblox that it should be doing something with it), ex workspace.part.Velocity = Vector3.new(0, 0.0001, 0) (that's meant to go right after w:Destroy())

If that doesn't work, first try 1 rather than 0.0001 -- if that one works, you can play around with it and see how low you can go. If 1 doesn't work, then you'll need to try something else. For instance, you could try moving its CFrame by a very tiny amount.

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