- Home /
my game is running damn slowly in android device?
I have created an android game, it is working well in my system but when i taking built in android device it struck and when play it runs damn slow even its taking too much time to load.I dont know whats the problem, may be problem in my rendering procedure. my built size is only 14 mb.Please anyone help me in solving this problem.
Application size is almost completely irrelevant to how fast your game runs. As @kiloblargh has already said, if you want help you need to give us a lot more relevant information on what you're trying to do: How many game objects do you have on screen? How many materials? Are you using physics? What are the quality settings? What shaders/image effects have you applied? These are some of the things that are likely to affect performance, particularly on mobile devices.
I am sending you my profiler image please have a look.
That many draw calls are a problem on Android, see if you can get dynamic batching working.
And now that you have the profiler on, just see what's taking up the most time and focus on improving that until it's not the thing taking the most time anymore. That "Car_AI.FixedUpdate" is a monster-the CPU shouldn't be taking up that much time, and scripts shouldn't be the heaviest thing in the game, and it looks like it's just that one script, so there is something wrong with how it was written.
Does an AI need to recalculate 30 times a second, or would once or twice a second be fine? Also, I think by putting it in FixedUpdate you are making it compete for CPU time with the physics engine. Change it to an InvokeRepeating and try different repeat rates.
Finally, the "Other" category is taking an alar$$anonymous$$g piece of the pie. Crack that open and see what is going on in there and what can be eli$$anonymous$$ated.
Answer by Kiloblargh · Dec 13, 2013 at 07:01 PM
A desktop PC has a much better graphics card than any mobile device. If you've been working on if for a while and only testing on the desktop PC, it may be that you've just made something that won't run on an Android and you're going to have to go back to the drawing board, and test constantly on the target hardware the next time.
Your question is very broad and you gave no information that would help someone diagnose your problem. At least post a screenshot. How many draw calls are you getting (click "Stats" button over the game view.) How many materials do you have in the scene? How many lights? Are you using real-time shadows? Built-in terrain with plants and trees?
The best thing about Unity Pro, which I still can't afford, is the profiler (the second best is probably the dark skin...) If you haven't yet used your pro trial, it's a good idea to do that when your game's almost done just so you can use the profiler. Otherwise if you have access to a $$anonymous$$ac, try building for iOS and using Xcode's profiler to see where all the milliseconds are going.
Answer by Fattie · May 06, 2014 at 11:09 AM
For the record, the simple answer is "Use the profiler...". A major and amazing feature of Unity!
Your answer
Follow this Question
Related Questions
PrintScreen with alpha in background 0 Answers
Send an activity from C# to Java 0 Answers
ERROR: Invalid Password for key 'google play public key' 0 Answers
Terrain issue for android device... 1 Answer