Hi all, I made a very simple game recently. It's a 2d space shooter. Only has one level, one type of enemy, one movement (right and left), seven scripts of roughly A4 size, and that's it. Yet it is too demanding for a Galaxy note5 which is capable of running Modern Combat 5 and Asphalt 8. The game runs just fine on my Huawei Mate 20X, but I still find it strange that it is too demanding for a Galaxy note5. Also, all the images and animations (the game only has 3) in the game are simple light PNGs. Any ideas?
What does your Unity settings look like? Perhaps you need to adjust your Level Requirement in Project Settings? If you have it set to a higher level than your device can handle, then I could see this being referred to as "too demanding". I don't know for certain though.
Check out the profiler and see what the causes could be. It could be that you are instantiating and destroying objects instead of using a object pool or that you are raycasting too much, etc. The profiler should point you in the right direction of what is so demanding.
Will check that ASAP. I am instantiating and destroying objects. But the game is laggy before I start shooting (which will lead to instantiate and destroy). Nevertheless, I'll check that as soon as I finish work.
Not a lot really. But I am rapidly instantiating and destroying bullets (maybe 200 to 250 per minute).
Could you please tell me what in project setting you think is important? (maybe I can take screenshots for you to see).
Well the first thing to know is this: Then you may wanna consider this: However, here is what I was referring to when I told you to check your levels earlier:
Do your bullets have particles attached that use the Noise? If so, you can severely affect your performance if too much noise is implemented. A little noise for a few bullets is okay, from what I understand, but 200 every minute would produce a disturbance. I wish that I knew more about it.
OP, please show us detailed profiler, at moments when game suppose to lag. Expand tree, where CPU is most intensive. Show physics, memory and GPU graphs. Best probably if record it as video, rather screenshots.
I have no shaders. Not any that I'm aware of. No they don't have any noise particles. I have attached a screenshot (I wasn't able to find the minimum API level). Since I don't have access to my phone now, I recorded the profiler for the PC version (link below). Can that show anything? if not, I'll upload the phone profiler tonight. https://gofile.io/?c=bCoA4Z
I just realised what the problem is and I apologise for not being more careful with this and taking your time. The background of my game is stars flickering. The background was added by my friend, and I was under the impression that it is a gif file. However, I just realised that it is not in fact a gif file and every star in the background is a particle with it's own shader. I replaced the background and it is working as it should now. Thank you again for your time and your help.
Did you try out: Edit -> Project Settings -> Quality And just try out "Fastest". I wonder if it helps