#Bool become active

1 messages · Page 1 of 1 (latest)

pallid owl
#

but i have set the minimum to 0.25 and at the start the numeber is 2/500 that is 0.04

#

@thin mango

thin mango
#

I asked you if you checked the condition, use a Debug statement to confirm if it runs or not

pallid owl
#

ok

#

yes it does

#

it run the first if

#

so it activate the bool

thin mango
#

There you go

pallid owl
#

yeah but it makes no sense

#

at the start the sick are 2

#

and the population is 502

#

i have putted percentualeMAMDS to be 1

#

so 2/502 > 1 ?

#

this is no sense

#

seems like it activate if the second if is true

#

no just kiddinh

#

g

thin mango
#

Have you used Debugs to check, perhaps also log some values so you can see them

pallid owl
#

yes

#

i have them public in the editor

thin mango
#

That is not what I asked

pallid owl
#

i have also loged them but they are the same

#

Debug.Log("Rimossi Totali : "+rimossiTotali);
Debug.Log("Popolazione : "+popolazioneTotale);
Debug.Log("Sani Totali : "+saniTotali);
Debug.Log("Malati Totali : "+malatiTotali);
Debug.Log("Immuni Totali : "+immuniTotali);
Debug.Log("Morti Totali : "+mortiTotali);

#

i have this at the end

thin mango
#

Unless this bool is being changed elsewhere, that condition is true and makes the bool true

pallid owl
#

mh

thin mango
#

I don't know why because I don't know the true values, but that is the issue

#

Actually, I do know why it just hit me

#

Oh no, you just put the braces at the end of lines

pallid owl
#

the braces are the { ?

thin mango
#

Yeah I thought you hadn't used braces on the second if

pallid owl
#

so you have found the problem ? sorry if i seem stupid but i am not english so sometimes i don0t understand everything

thin mango
#

No I've no idea

pallid owl
#

ahhhhhhhhhh

#

is not present a {

#

no

#

no is not that

thin mango
#

What are the values of malatiTotali, popolazioneTotale, and percentualeMAMDS in the Inspector?

pallid owl
#

tempo 0

#

tempo 1

thin mango
#

Wait, in the first example you're diving 2 by 0?

pallid owl
#

no no

#

yes

#

ops

thin mango
pallid owl
#

i calculate the population after doing that

thin mango
#

Yes you are, 2/0 is what?

pallid owl
#

so i just need to invert the order

pallid owl
#

this is after

#

that

#

so i just need to put this before

#

and is solved

thin mango
#

Give it a go yeah

pallid owl
#

it works

#

thank you very much man

#

i give you a digital hug

#

well use immagination