getRandom always returns same values on ipad hardware?
by Randy Condon · in iTorque 2D · 10/31/2011 (12:37 pm) · 8 replies
Has anyone had this problem?
I have a group of objects that call getRandom within their onLevelLoaded function.
When I run on the simulator, everything is as expected.
When I deploy and run on the iPad2 hardware, iOS 5, iTorque 1.5, xCode 4.2, I get the same values for all the objects.
System.cs calls setRandomSeed();
So to summarize, everytime getRandom(0,3) is called, it returns 3. But only on iPad 2 hardware, not the sim.
Thanks
I have a group of objects that call getRandom within their onLevelLoaded function.
When I run on the simulator, everything is as expected.
When I deploy and run on the iPad2 hardware, iOS 5, iTorque 1.5, xCode 4.2, I get the same values for all the objects.
System.cs calls setRandomSeed();
So to summarize, everytime getRandom(0,3) is called, it returns 3. But only on iPad 2 hardware, not the sim.
Thanks
About the author
Senior producer at Sanzaru/Tomozaru Games, Inc.
#2
11/05/2011 (9:45 pm)
I use getrandom all the time on iPad 1 and it doesn't appear to have this problem.
#3
is working like a champ for each of my 5 reels in my slot machine project on an iPad 1.
11/05/2011 (10:45 pm)
Same here, I haven't had to use it a lot yet, but:$totalSpinsReel1 = getRandom(4,$totalTilesPerReel /4);
is working like a champ for each of my 5 reels in my slot machine project on an iPad 1.
#4
11/07/2011 (2:14 pm)
Are you guys running ios 5? Thanks for the replies, too.
#5
11/07/2011 (6:15 pm)
iOS 5 here on my iPad 1.
#6
I'm using iTorque 1.5
11/08/2011 (2:21 am)
I'm using getRandom() a lot and never had any issues, both on the device(ipad 1 iOS 4.3, ipad 2 iOS 4.3 and 5) and on the simulator.I'm using iTorque 1.5
#8
11/09/2011 (12:55 am)
Does the problem also occur when you remove the setRandomSeed() call?
Randy Condon
Tomozaru Games, Inc
That worked for me.