Beri
Beri

Reputation: 245

How to hide an object while it is in precollision event state in Corono SDK?

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

Answers (1)

Oliver
Oliver

Reputation: 29591

It should be platform.isVisible not obejct.isVisible.

Side note: you don't need semicolons and the comment is wrong.

Upvotes: 1

Related Questions