- Home /
My Script Won't Update
here i am once again. So i am following the unity tutorial about variable and functions and my script doesn't do what i have told it to do, for example i start with this
using UnityEngine;
using System.Collections;
public class VariablesAndFunctions : MonoBehaviour
{
int myInt = 5;
void Start (){
Debug.Log (myInt);
}
} And it works! It prints my int into the console (5)
But then when i update the script to make it multiply myInt by 2 it doesn't it still types 5 into the console, here's the script
using UnityEngine;
using System.Collections;
public class VariablesAndFunctions : MonoBehaviour
{
int myInt = 5;
void Start (){
Debug.Log (myInt * 2);
}
}
What am i doing wrong? If anything
I'm a little surprised that didn't work but generally debug.log isn't the place for math calcs its for string or string representation output.
are you sure? I have saved and everything but it prints 5, i could take a screenshot if you like?
Answer by TheBlackBox · Feb 20, 2014 at 11:29 PM
I fixed it, i just had to sync monodevelop with unity, thanks anyway guys.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
My character can't move and he also falls through the terrain! 1 Answer
Developing XBox 360 games? 2 Answers