I just solved a problem in my cycling code, but then another one appeared, and this one got one bug that i dont really know how to explain, but here it is:
My code:
function Start () {
};
function Update () {
};
function continous () {
if (cicling < 1) {
Debug.Log("First part of the cycle");
};
else if (1 <= cicling && cicling < 2) {
Debug.Log("Second part od the cycle");
};
else if (2 <= cicling && cicling < 3) {
Debug.Log("Third Part of the cycle");
};
else {
Debug.Log("Fourth Part of the cycle");
cicling = -1;
}
};
var cicling : float = 0;
InvokeRepeating("cycle1", 0, 0.5);
InvokeRepeating("continous", 0, 5.0);
function cycle1 () {
cicling = cicling + 0.1;
};
for some uknown reason, in unity debug.log shows the message “third part of the cycle” twice.
please help. :C