Hello,
I’m following a book tutorial on basic C# scripting in Unity. The author made a script that I followed, and it worked; it was a simple math problem. Then he changed the 9 to a 19 in the Inspector tab (which I couldn’t do–I had to go do it in MonoDevelop). I did the same, but my math answer still did not change even though the number was bigger. I’ve attached a screenshot.
This is the code I have:
using UnityEngine;
using System.Collections;
public class LearningScript : MonoBehaviour {
public int myNumber = 19;
// Use this for initialization
void Start () {
Debug.Log (2 + 9);
Debug.Log (11 + myNumber);
}
// Update is called once per frame
void Update () {
}
}
But the 11+“19” still shows up as 20