Hi! I have code:
public float randF = -12.0f;
bool ToF = true;
void Update() {
if (ToF) {
Debug.Log(randF);
` ToF = false;
}
}
I press “Save” in VS and “Play” in Unity.
Then I change variable: randF = 12;
Press “Save” and result does not change.
-12
UnityEngine.Debug:Log(Object)
Only when I change “public” to “private” or “private” to “public”, result changes.
Why?