Equip and Unequip a torch?

How can I do this. I attempted it with this script and it was a fail. alt text

you could try this:

gameObject.renderer.enabled = true/false;

hope that could help a little

You're destroying the TorchPrefab link, rather than the 'torch' that you've instantiated. You want:


Also, every time you press Fire2, you'll spawn a new torch. You could use a boolean to store whether or not the torch is spawned, and only allow a new one if it isn't (and only attempt to destroy it if one exists).