This is only a small snippet of my code, but I checked over everything, including braces, and everything runs fine without this statement, I can't tell what is wrong with it though (the subprogram it called is a random float generator btw)...
'''
float funnelDirection = randomFunnelDirection();
float funnelR = funnelDirection;
if (funnelR == 1f)
{
funnelR = -1f;
}
else
{
funnelR = 1f;
}
float reverseFunnelDir = funnelR;
'''
Since people said that this specific code is not the problem, this is the only other part of the code that uses the if-statement from above
'''
if (funnel.GetPos().x > 0)
{
funnel.Move((funnelSpeed * funnelDirection), 0);
}
else if (funnel.GetPos().x <= 0)
{
funnel.Move((funnelSpeed * reverseFunnelDir), 0);
}
'''
Aucun commentaire:
Enregistrer un commentaire