So guys, basically i want to destroy the ORC object when he hits the Fire:
This is what a have:
-- Function that detects collision beetween Orc and Fire local function fireCollision(self, event) if event.phase == "began" then if event.target.type == "fire" and event.other.type == "floor" then self:removeSelf() elseif event.target.type == "fire" and event.other.type == "fire" then self:removeSelf() elseif event.target.type == "fire" and event.other.type == "orc" then orchealth = orchealth - math.random(40, 101) if orchealth \< 0 then killOrc() end print(orchealth) end end end
And this is the function that kill/destroy the object
local function killOrc(obj) obj = event.other.type obj:removeSelf() print(obj) end
I’m not sure how to by specific about what object should be destroyed.