Different "AdventureGame.cs" Properties

Hi everyone!

I am a little bit confused, because the Inspector shows different properties for “AdventureGame.cs” when I view it directly as a separate asset (Screenshot 1) and as an attached component of the “Game” GameObject (Screenshot 2).

Screenshot 1
S0

Screenshot 2
S1

It looks like changes made to initial values of “statingState” and “textComponent” have effect only if made from the “Game” GameObject and have no effect at all if made from the “AdventureGame.cs” script.

Why do we have these editable fields (“statingState” and “textComponent”) in the “AdventureGame.cs” properties while they are completely overwritten by “Game” properties and seem to have no effect?

Hi Aidar,

Welcome to our community! :slight_smile:

According to the messages in your first screenshot, you can set the default references in the Inspector of the script.

The actual object gets created when we assign the script to an Inspector of a game object.

What happens if you assign default values to the script and then drag and drop the script into the Inspector of the Game game object? Do the fields of the newly created object say “None” or do they contain the default references?

This topic was automatically closed after 43 hours. New replies are no longer allowed.

Privacy & Terms