Why Is the Script Not Doing Anything?

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

When you assign an initialized number it stay’s the initial number you assigned, so it would stay 9. Try changing the value in the start function or in the inspector. ( Bit of a tongue twister

Got it, thank you very much!