im a NEWBIE!!! to C# and following a book... and the code isnt doing as the book says..the book is telling me to use the Unity 3d engine
plz keep it as newbie friendly as possible thank you
the code and the output isnt matching up right...what am i doing wrong...
using UnityEngine;
using System.Collections;
public class Leaningscript : MonoBehaviour
{
public int myNumber = 10;
// Use this for initialization
void Start ()
{
Debug.Log(2 + 9);//non varible should show 11
Debug.Log(11 + myNumber); //using varibles should show 21
}
// Update is called once per frame
void Update ()
{
}
}
now the line that should appear as 21 outputs as 20...
i found out that if i change the variable in the code itself it doesnt change...
but if i change it in the inspector panel it will change...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.