Global Call to disable

I have a chest script, using enums to tell which state the chest is in. I’m trying to find a way to somehow close all chests in my scene besides the one that I’m inside, or if I were to click another it would close the one I was already in.

enum ChestState { Open, Opening, Closed}

You can use FindObjectsOfType to find all of your chest scripts in the scene. A more optimal way would be to store references to all of your chest scripts (perhaps a ChestManager class) so you don’t have to keep calling that function (it’s quite slow).

Thanks Daniel! Got it working.

Cheers!