Disabling then Enabling components possible?

Hi, I want to make a coin appear after defeating an enemy and I need to disable the collider and mash renderer until the enemy is defeated, then enable them by script. But I do not want to delete the components by using the destroy function: destroy(). Is the disabling then enabling method possible or is there a easier method?

P.S. I am using JavaScript :wink:

The proper way of doing this is instantiating the coin from a prefab once the enemy is defeated, using Instantiate().

Oh, I think I kind of forgotten about that. Thank you. :sweat_smile:

1 Like