Quantcast
Viewing latest article 12
Browse Latest Browse All 215

Get gameObjects from a protected GameObject array of base class in derived class

I have a `StageScript` in which I am filling an array in the inspector named `UnorthodoxSeats` marking it as `[SerializeField] protected GameObject[] UnorthodoxSeats` in the script. When the script runs, after some time a Character is instantiated to move towards the seat. The Character has also a script named `CharacterScript` which is the derived class of `StageScript`. Now, In the `CharacterScript` whenever I get `UnorthodoxSeats.Length` it shows `0`. I am confused why? Any help would be awesome.

Viewing latest article 12
Browse Latest Browse All 215

Trending Articles