- Home /
The question is answered, right answer was accepted
Double are calculated only when I use debug.log with them ?
I have a double variable that is calculated only when I use debug.log() on her, why?,Hello, i have a function that calculate a double and return it, then I add it to another double and I use it for a path finding solution. The problem is when I don't do Debug.log( varName); where varName is my first double the program skip the function and leaves my varName = 0;
there is no way thats happening, can you paste your code so i can take a look? cant help you without.
densita = Game$$anonymous$$anager.CalcoloDensita(casellaVicina.getX(), b.mappa[start.piano].getY() - 1 - casellaVicina.getY());
//Debug.Log(densita); if I remove the comment it will calculate the densita, if not no
costoTotale = nodoCorrente.costo + densita + 1;
public static float CalcoloDensita(int x, int y)
{
float valueTemp = -1;
List<TrackingTileData> listaT = Game$$anonymous$$anager.getIstance().listaT;
foreach (TrackingTileData var in listaT)
{
if (var.x == x && var.y == y)
{
valueTemp = var.value;
break;
}
}
if (valueTemp == -1)
{
return 0;
}
if (valueTemp > 70)
{
valueTemp = 70;
}
return valueTemp / 70;
}
can you put a break point at the end of the CalcoloDensita method? just before the return and make sure if in both cases is entering the method and check valueTemp value?
Follow this Question
Related Questions
Menu button needs to be double clicked. 4 Answers
Score Points and Animation 0 Answers
How to round or convert doubles? 2 Answers
Cant convert double to float? 1 Answer
How to make a variable double value? 1 Answer