why does the value of a specific variable change in different functions unity
Answers
Answered by
0
Are you sure this gets compiled into the constructor? Since using the constructor is not recommended with MonoBehaviours for good reasons I don't think this is the case (in particular for the second example); that's what Awake() is for (initialization). From the recommendations for writing scripts in C#, I would conclude that in fact, javascript code outside of functions that needs to be executed goes into Awake(), and member variable declarations
Similar questions
English,
7 months ago
Science,
7 months ago
Chemistry,
1 year ago
Environmental Sciences,
1 year ago