Game Lags on High-End PCs

Hi friends,

Very new to Unity and coding in general. About finished with my first game, and I’m having some issue with lag when I test the game on other devices. It works fine on my PC and on my low end laptop, but some of my friends who are playtesting it (including one with a very good pc) are reporting that it lags occasionally (sound get glitchy, animations slow down, etc).

I don’t know anything about optimization, so there’s probably a lot I could do make things run smoother that I haven’t done. But it’s a 2d game (basically just a visual novel with minigames), so I didn’t think lag was going to be issue. Does anyone have any idea what this might be? All I know is it doesn’t happen on my setups, but it can happen on others with better specs.

The only other things I can think of that could be messing it up are that I use Application.targetFrameRate and QualitySettings.vSyncCount so that the game runs at 60fps all the time.

Sorry for the vague question. If anybody knows what might be causing this, I’d really appreciate the help.

(Also, the game DOES lag for me in the editor, but I have yet to replicate it in standalone builds so I not sure how relevant that is.)

You can use the profiler when testing to see what the problem might be and find “Code Hotspots”.
Besides that, compiling it to CPP (IL2CPP) might help you. I had a similar issue on Android and this resolved it.