Reputation: 245
I need to hide object while it is in precollision event here is the code i tried.
-- Remove event listeners
function bird:preCollision(event)
local platform = event.other
if platform.myName == "object" then
scoreText.text = scoreText.text + 1;
obejct.isVisible = false;
end
end
bird:addEventListener( "preCollision")
Upvotes: 0
Views: 85
Reputation: 29591
It should be platform.isVisible
not obejct.isVisible
.
Side note: you don't need semicolons and the comment is wrong.
Upvotes: 1