So use GetTouchingParts? most of that code uses mouse stuff.
You can convert the event. There is a tedious solution too.
Weld an unanchored part to the part that is touching workspace.Plates then put the .Touched event to the welded part.
Do I use a Weld or WeldConstraint?
WeldConstraint
Okay, that’s what I thought. Making sure
Here is the code to solve this. Using physics is the easiest way and it will be automatically interpolated on the client so it’s smoother.
local part = newDrop
part.Anchored = false
part.CanTouch = true
local attachment = Instance.new("Attachment")
attachment.Parent = part
local velocity = Instance.new("LinearVelocity")
velocity.MaxForce = math.huge
velocity.VectorVelocity = Vector3.new(0, -0.1/0.03, 0)
velocity.Attachment0 = attachment
velocity.Parent = part
part.Touched:Connect(function(hit)
print("Hit "..hit.Name)
if hit.Parent.Parent == workspace.Plates.Active then
print("Hit ground "..part.Name)
velocity:Destroy()
attachment:Destroy()
end
end)
You probably messed up setting up the constraint, so I made the code do that for you.
I’m not sure why, but even after welding the part it didn’t actually weld if that makes sense
OMG finally, thank you so much
One question: Is there a specific reason to use “-0.1/0.03” over just -3.33?
No I’m just lazy
(I wanted it to be the same number as your current code, didn’t want to do the math, and because of how lua calculates those numbers it doesn’t affect performance.)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.