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
Geography,
6 months ago
Computer Science,
6 months ago
Math,
6 months ago
Chemistry,
11 months ago
Environmental Sciences,
1 year ago