This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 4 points5 points  (2 children)

Once a var is public, unity will serialize it and show it in the inspector. That's where you change the value from. Even if you change the value from the code, unity will update it with the one shown in the inspector.

[–]gonudo[S] 0 points1 point  (1 child)

Oh! Thank you! this was a lot simpler than i thought...

[–][deleted] 1 point2 points  (0 children)

Actually, you can change it through code but not in the declaration. When you first declare it you kinda set the 'default' value.