I have create one game which player can drag animals up and throw it out the fence to defense zombies’ coming for their homeland.it runs perfect on an iPhone and Samsung Galaxy,but when application runs on some mobiles which do no have very high speed hardware.here pop out the question:Not until the animal be dragged out the fence for a distance,then he realize it’s already have to change state(When animals be dragged over the fence,it will change to fly state)
void Update()
{
if (animal.transform.position.y > fence.transform.position.y)
Debug.Log("Change to fly state");
}
How to solve this kind question,thanks!
Hell There,
I’m not sure if I fully understand the question, but on mobiles, as in any platform, performance issues can ruin the game, that is because the Update function you created hasn’t got time to run one more cicle ( due the low framerate ), thus creating your problem.
What I would suggest is to firstly check if it’s really necessary for your game to perform on those lower-end, sometimes it’s just not worth the work.
If you are positive you need your game to run on them, I would recommend running the profiler and performing the optimizations.
I wrote a blog post a while ago on the matter, if you’re interested take a look:
http://blog.breakingfingers.com/post/29838128841/fighting-for-frames-mobile-optimization
Hope it can be of use.