Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

An error occurring only on 4,7 inch iPhones

in Bugs Posts: 9

I made a variation of the example "Flappy". I exported it to Xcode, and it works on any device, except the iPhone 6 and 6s (The Plus versions work perfectly)
This is the error:
Main:83: bad argument #1 to 'random' (number has no integer representation)
stack traceback:
[C]: in function 'math.random'
Main:83: in function
'spawnNext'
Main:49: in function 'reset'
Main:14: in function 'setup'

Does anybody know how to solve this?

Comments

  • dave1707dave1707 Mod
    Posts: 8,182

    You have to make the number in random an integer. You can do that by random(math.floor(number)) where number is whatever is in the random statement.

Sign In or Register to comment.