In a script I am working on, I made a function to sort some variables, but nothing happens when I run the game, so I thought it might be that nothing called the function.
What should I write to call a function one time every time a bool turns from false to true?
I have tried to search google, the forums, the wiki, but I cant find anything
is there any way to do this without using update, becouse the update function fires of every frame and I am trying to make it fire of one time
Maybe something like this
//not actual code
static var PowerLevel = 0;
var somethingHappened = false;
//another script changes the power level
<thing that fires of function Something when somethingHappened turns true>
function Something () {
if (points >= 9000) {
Debug.Log ("Its over 9000!!!");
}
}
I have read it before and it is a great tutorial thanks a lot for making it:smile:, but I cant find exactly what I am looking for
Where should I tell the script to call the function (without using update)?