Game lagging a lot on Android build

I’ve been trying hard to optimize my game for weeks and on PC it runs really smooth.
On my Samsung A51 it is very laggy, though, despite the game being a really simple 2d multiplayer.

It’s a 2D multiplayer minigame:

  • lights with Smart Lighting 2D, 6 lights in the scene + players and a few barrels as light colliders
  • Photon Bolt as networking engine
  • about 10 player instances in a game with custom Animators
  • players grow as they level up in the arena and the ortographic size of camera increases.
  • 6 instances of simple fire particle effects (two layers, I gave up on smoke) in the scene
  • players see always only one light and one particle effect

I tried to reduce the amount of Animators in my game and my only sin I’m aware of is that I have a UI canvas in world space for each player.

I’m updating Animators of other players only when they are close to the player and I deactivate UI Canvas of such players as well when too far.

What I tried and didn’t work:

  • enabling Multithreaded rendering
  • dynamic resolution
  • reducing DPI (I’m already at 300 and going lower didn’t help at all)

I’m starting to lose my mind. :smiley: Any ideas? This is a screen from my phone remote profiling without multi-thread rendering.




Looks like it’s mostly rendering, so what debug options do you have for Smart Lights?

What does the Frame Debugger look like?

What happens if you turn all lights off and measure again?

Frame debugger looks in worse cases like this

With Smart Lighting turned off GPU seems much better. But still lagging and horribly looking now. :smiley:


.

Are those UI bars above characters on a Canvas? Canvas bars that move per frame are not very performant. Switch them to just being Sprite Renderers, that should save a lot, and that’ll work with the top-down kind of game you have.

However, still the great problem is the rendering, and the Frame Debugger’s output does not look bad.

So clearly most of the problem is with your Smart Lighting settings, so go check out their Discord and see if you can get more particular help there. I’m not familiar with Smart Lighting on mobile so you may be up against a wall and need carefully constructed scenes.

post a screenshot of player settings

Yes. But they have functionality like fills (radial and horizontal), two TextMeshPro texts and those scale as player’s prefab scale (quite often). If this is the culprit, I might do as you say.

I also considered doing that outside of word space, but it introduced other problems.

Yep, I’ll have a call with the Smart Lighting guy. Thanks!

Try
Vulkan Only
Multithreaded rendering on
static batching off
dynamic batching off

Although this is a Unity 6, 3D URP, based recommendation. I dunno if it performs the same with gamma rendering and built-in.

I massively reworked the player UI so that now there are no more Canvases in World space.
It seems it helped a lot, though it’s still not smooth.

Plus I gave multithreaded rendering a chance once again.


It’s still lagging on my phone even with release build.

Perhaps my phone is just crap? :smiley: But I think I’m missing something. On my PC it ofc runs super smooth.

Assuming you’re using URP, Drop the render scale to 0.5. It’s usually not necessary to use the full resolution on these little high res screens phones have. Should render 4x faster and still look almost the same


Have you find a solution? My 2D game is also lagging a lot on a Galaxy S25 Ultra brand new! Maybe something buggy in Unity? The game runs fine on iPhones, macOS and Windows builds

I suggest to make a new post with all the details (feel free to ping me, I do a lot of optimization).
Likely there is some settings enabled for Android and not the rest, or a setting which performs worse on Android GPUs is enabled.

Despite my best effort, it’s still not completely smooth. It is much better, though, as I started culling the players on the network side. Also I reduced resolution of the light and reworked UI completely.

Thanks, if you scroll up a bit I already posted a screenshot of my settings. :slight_smile:

My message was to Diego, as performance issues are very project dependant. I can’t really help much further without being in the project tbh