I’ve been stuck for a while trying to work out how to get this working so would really appreciate any help I can get!
I have a set of spawners in my project. Each spawner instantiates a randomely selected prefab when the game begins. Within each prefab is an object which has a couple of different layers which I am trying to allow the player to toggle through using arrow keys - only on the object they have selected.
The problem I keep running into is that these layers toggle through on all of the instantiated prefabs. I’m not sure what to do because I believe I need to attach the layer gameobjects on a script inside the prefab. Currently they’re attached to a script which simply uses SetActive as the player scrolls switches layers.
How can I reference only the layers of the one selected instantiated prefab and not all the other prefabs of the same kind in the scene?