Hi guys,
I have this piece of code.
candy_currentLerpTime = 0
while(Candy[Index].transform.position.y > postDropPos.y && paused == false)
{
Candy[Index].transform.position = Vector3.Lerp (startPos,
endPos, (candy_LerpTime+=Time.deltaTime));
yield return new WaitForEndOfFrame();
}
in Editor, the while loop moves the Candy
and after it reaches its destination the loop exits.
When I build it on my phone (iOS) the while loop gets stuck
I debugged it while its stuck and this is the output:
startPos = (-1.3, 5.0, 0.0)
endPos = (1.3, -5.3, 0.0)
Candy[Index].transform.position = (1.3, -5.3, 0.0)
-
candy_LerpTime
keeps increasing way past 1 because the loop is stuck Candy[Index].transform.position.y > postDropPos.y = true
Candy[Index].transform.position.y == postDropPos.y = false
paused = false
Can anyone tell me what’s wrong here?
How is Candy[Index].transform.position.y > postDropPos.y = true
when both positions show same coordinates and how come this works in editor but not on the phone???
Thanks