Editing properties of game objects inside an array using the inspector.

Hi Everyone,
I have an array of game objects and the array is a property of a game object. The game objects in the array have properties, such as speed, location, etc. Now, inside the inspector, I can set the size of the array in addition to setting the game object that will be used in each index, but I can’t get to the properties of those game objects (i.e. speed, health, location). So, my question is - is there a way to access those properties from within the inspector?

Thanks!

you need to find the GameObject they refer to in your Project tab or Hierarchy tab.

they should pop up yellow when you click on the reference in the inspector. or just double click on it.

If you put [System.Serializable] right at the top of your class, and then you can access the class’s properties in the array within the inspector. For example:

[System.Serializable]
public class MyClass {
      //...
}

I hope that answers your question :slight_smile: