Hi, I am making a C4, and it works fine, the problem is when sticking it to what it hits. When it’s hit and I weld it to the hit part, WeldConstraint pulls it back like this:
It only happens when the C4 hits the part properly.
Here’s my code:
local con;
con = script.Parent.Touched:Connect(function(hit)
if not hit:IsDescendantOf(script.Parent.Parent) and not hit:IsDescendantOf(script.Parent.Object.Value) then
warn(hit)
con:Disconnect()
local weld = Instance.new("WeldConstraint")
weld.Parent = script.Parent
weld.Part1 = hit
weld.Part0 = script.Parent
end
end)
It doesn’t happen when using Touched
event on the client.
Help is appreciated!