Hello all, i’ve been working on my game and i notice something weird. I tried to reproduce it but it only happens randomly.
Issue:
greater than won’t detect properly, it will detect 0.2 > 0.2 = true for example.
The weirdest thing is it happens 90% of the time in my game. (Its the only function that deducts that particular variable, double checked)
Here is the code to reproduce it (random chance):
[lua]local a = 0.3
local b = 0.2
local function temp( event )
if a > b then
print(a … “>” … b)
a = a - 0.1
end
end
local function touched( event )
if event.phase == “ended” then
a = a + 0.2
end
end
local function main()
timer.performWithDelay(1000, temp, 0)
Runtime:addEventListener(“touch”, touched)
end
main()[/lua]
any help would be appreciated, its really killing me ._. Thanks in advance
EDIT: Updated with full portion of code to reproduce the bug [import]uid: 74723 topic_id: 13081 reply_id: 313081[/import]