- Home /
android touch optimization issue
I'm making a android game with lots of rigid bodies and the game itself runs pretty well (30-50 fps) but the problem I'm having is that when the screen is touched the frame rate drops horribly to around 5 fps. I'm thinking the rigid bodies are being tested to the touch screen however I don't need them to be. My question is, is there a way to turn off raycasting from the screen touch for objects that dont need the input?
Thanks, Frank
There is no automatic testing - what code do you have that uses touches (or possibly mouse)?
only 3 gui buttons. I've been reading that it could be my 600 mhz phone is just a dinosaur and just cant process much which I'm satisfied with that answer. Though it seems odd that there's not a way to tag only certain objects for touching or completely disable the screen. In my phone at least it takes about half of the phones cpu I think just to touch the screen regardless if theres anything there or not.
That is very very strange, normally you would be calling your own code to do that testing (touch screens don't be default support On$$anonymous$$ouseDown on objects - you have to raycast yourself).
$$anonymous$$ind you OnGUI on a phone is a bit of a no-no - it does so many calls (but then you'd hardly believe that it could make such a big impact).
Answer by frankrs · Jul 13, 2012 at 06:55 AM
Mind you OnGUI on a phone is a bit of a no-no - it does so many calls (but then you'd hardly believe that it could make such a big impact).
does this happen on demand when implementing code or automatically unless you switch it off?