Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I made a cubeMesh. And then I set it's X Rotation to 0.1 After getting its rotation variable, I used this code: If ( rot .x == 0.1 ) { ....do some thing .... } And I tested it. It worked well on Windows but did not work on Android. Then I used this code instead and it worked !!! on Android: If ( rot .x > 0.09 && rot .x < 0.11 ) { ....do some thing .... } It should be noted that in larger values, for example, if I had initially X rotation = 1, it would work fine. .It's so weird. Whatever I thought, I could not find a logical reason for it |
||||
|
That's not a bug, that's how floating point work. You figured out yourself how to fix this. The usual way is to test for a small value below and above the value you want. |
||||
|
Thankful. So why did it (== ) work in Windows ? |
||||
|
Alireza, you must understand the Android Code its not the same with the Javascript. Integer or floating operators its not working in Android cellphones or iOS. Check the code again, something its missing for the Android implementation code or play around with the values to fit in what you need. |
|