how to make a box appear then disappear when tapped

Hello you guys

I’m making a game in which 2 boxes are generated when I hit start, and when I tap the correct one the boxes disappear then two more appear and for ach correct tap the score is kept. The problem I’m having is making the box appear then disappear.

What are the correct functions in making this happen?

Thanx in advanced…

Are we talking like fade in and out using a time based animation or toggle on/off?   Do you want to remove the box after it disappears from memory?

There is object.isVisible = true/false to show/hide and transition.fadeIn(…), transition.fadeOut(…), transition.to(…), transition.from(…) functions. Setting the alpha to various levels to fade could work using a transition.

For instance you could make the box fade and rotate/slide off screen.

Are we talking like fade in and out using a time based animation or toggle on/off?   Do you want to remove the box after it disappears from memory?

There is object.isVisible = true/false to show/hide and transition.fadeIn(…), transition.fadeOut(…), transition.to(…), transition.from(…) functions. Setting the alpha to various levels to fade could work using a transition.

For instance you could make the box fade and rotate/slide off screen.