activate a component in a game object from an array
Hi I have 5 game objects ( Cube 1 to 5) and they have are all visible in the game. I have used a script to activate and deactivate it . so the object flashes.this works great.This script in the Cubes is now set to inactive.I now want to use an array or similar to activate my script to 1 of the 5 Cubes , hens making them flash independently at random.I have created 5 empty game objects (Called Script Apply) Added my get component script to each one Then added 1 of the Cubes to each get component script So now I have 5 Script Apply objects with my get component script attached and each script has a different cube associated with it.Now when It plays all 5 objects flash Perfect.I have created an array and added the Script Apply Objects.But when I transfer Script Apply object to the array it looses the cube application. On play all cubes flash because the get component script is active in the hierarchy. So I changed the Script apply Object to a prefab and removed them from the Hierarchy great now no flashing on play. But Cubes are visible. I applied the Cube to the prefab and then applied the prefab to the array. Great now the array holds all the Script Apply Objects . On Play the array shows cloning of the script in the console but does not apply to the active game object.Can anyone help please.