Hi, I need help destroying a physical object that I use to make crystal balls.
Crystal ball is picked up by the player and accumulates points ( no problem with this rating there )
The crystal ball which is the child of the physical ball disappears, but not the physical ball.
How do I edit my script to have the physical ball destroyed?
PS: i test " PHYSICS_OBJECT:Die() " but dont kill
local propCoinSound = script:GetCustomProperty("CoinSound"):WaitForObject()
local Manticoin = script:GetCustomProperty("Manticoin"):WaitForObject()
local Manticoin = script.parent
local PHYSICS_OBJECT = script.parent
-- When a player hits the coin, increment a resource on the player and remove the coin
function handleOverlap(trigger, object)
if object ~= nil and object:IsA("Player") then
propCoinSound:Play()
trigger.isEnabled = false
object:AddResource("Coins", 1)
end
end
-- Whenever an object collides with the trigger, run this function
script.parent.beginOverlapEvent:Connect(handleOverlap)
My structure in hierarchy
ty for help, sorry i use translate