You can enable and disable sprites and other components by posting a message to the components.
You can achieve a delayed function call in many ways:
-
Use a timer module of some kind. One example is presented in this post: My sleep() function freezes whole game, ideas? (SOLVED)
-
Use go.animate on a dummy property:
go.property(“timer”, 0)
go.animate("#", “timer”, go.PLAYBACK_ONCE_FORWARD, 0, go.EASING_LINEAR, 4, 0, function()
msg.post("#sprite", “enable”)
end)