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

Part won't position to explosion?

Asked by
TechModel 118
2 years ago
Edited 2 years ago

Making a custom explosion, and so I created a part with 2 particles, one is the smoke and the fire. When a explosion is created, it is then part clones with the particles and parented in a folder called effects in workspace but position wise, that part isn't working. Part is positioned at the centre of the world 0,0,0 instead of the explosion happening at for e.g. 126,35,235.

local work = game:GetService("Workspace")

work.DescendantAdded:Connect(function(descendant)
    if descendant:IsA("Explosion") then
        local p = Instance.new("Part")
        p.Position = descendant.Position
    end
end)

1 answer

Log in to vote
1
Answered by
Y_VRN 246 Moderation Voter
2 years ago

You have to parent the Part to Workspace.

local p = Instance.new("Part", workspace)
Ad

Answer this question