Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Part not falling through destroyed terrain?

Asked by 4 years ago

Hi, I recently made a script that makes an explosion wherever you click and I put a part on the top of the terrain when the terrain was fully exploded the part was still sitting on the top of where the terrain used to be. Here is my script:

local player = game.Players.LocalPlayer local mouse = player:GetMouse()

local part = Instance.new("Part") -- You can just change this to part.Parent like you were doing before. part.Parent = workspace part.Anchored = true mouse.TargetFilter = part -- The mouse will ignore the part so it doesn't end up above the mouse position

mouse.Button1Down:connect(function() part.Position = mouse.Hit.p local ex = Instance.new("Explosion") ex.Parent = workspace ex.Position = part.Position-- mouse.Hit.p is a Vector3 already -- mouse.HIt.p is equivalent to Vector3.new(mouse.Hit.p.X,mouse.Hit.p.Y,mouse.Hit.p.Z) end)

1 answer

Log in to vote
0
Answered by 4 years ago

The part might be Anchored. If it is anchored, then the part won't fall. So, try turning off anchor if you did.

0
Tried, I've moved on now AlekGamer_TV -5 — 3y
Ad

Answer this question