Public arrays of GameObjects in script not found in Inspector

I’m working in Chapter 5: Managers and Pathfinding. I’ve created the GameManager script and populated the class with three public fields:

public GameObject player;
public GameObject[] spawnPoints;
public GameObject alien;

When I look at the Inspector while the script is selected I can see Player and Alien, but spawnPoints is missing.

I have the most recent version of Unity (2017.1.0f3 Personal).

I’ve looked at the solution and spawnPoints is not present in the Inspector here either. But the game works.

I’ve explored Google and tried the obvious things (e.g, adding a [System.Serializable] attribute to the GameManager class, but this doesn’t help.

Am I doing something wrong or has something changed in Unity?

Thanks for your help!


Oops. Newbie error! I was selecting the script and looking in inspector rather than the game object in hierarchy. All is well. Maybe this will help someone else.

Ha, happens to the best of us, glad you solved the issue though! Feel free to let us know if you run into any more problems in the future!

Have fun with the book, look forward to seeing what games you come up with :eyes:

This topic was automatically closed after 166 days. New replies are no longer allowed.