Game is smooth in editor, but laggy (jagged movement) on build version

I have been testing my current RPG build to see how it performs after building and realized its not in a pleasant condition at the moment. While in editor it plays flawlessly / everything is smooth with no lag whatsoever.

FPS is average 110 while in unity editor

Also on terrain settings I have been toggling around with detail distance, density, billboard start etc… tested with low, medium, high values and performance is still the same on both editor and build version. Another thing that drew my attention was the warning in “Mesh Resolution” with the following message
“You may reduce CPU draw call overhead by setting the detail resolution per patch as high as possible, relative to the detail resolution”.

From this warning, google has lead me to unity threads talking about draw calls, and changing to a very low value for improved performance. Where is this value set? . I have changed the values

  • Detail resolution per patch, Detail Resolution
    from very low to very high, but I still get same performance in both instances. Smooth in editor, rough in build version.

I have even gone to the extreme lengths of removing any / and all grass in my scenes with no luck, and getting same performance issues either way.

The choppy effects are very noticeable in this sample video, which is running a build version.

https://www.youtube.com/watch?v=6yQfiulVwqA

In unity editor, I dont get this at all and the game runs like fine tuned Ferrari. What would the specific culprit be in this case if one goes around digging into the profiler


1 Like

I had similar issues with my movement when I was going through the RPG course. I was able to resolve mine by putting the calls to the character movement into FixedUpdate() instead of Update()

Edit: Also, really nice looking scene you have going there :slight_smile:

thanks, almost done with old course content (one more video to go I think)… and just finishing building the village / placing props / environment. Then gotta have a look at the remastered content after this.

anyways your comment about FixedUpdate did improve things a bit. I changed one of my mouse orbit scripts from LateUpdate to FixedUpdate and build version runs smoothly for 90% of the resolutions I have tried.

Theres still one or two resolutions with some jittery stutter but I can live with that for now. I dont get why such an issue isnt picked up when running the game in unity editor… so one can be aware before building the game. I suppose one has to study the workings of the profiler to prevent such issues in future.

No problem, I’m glad it helped. It made a night and day difference on my end. I had the issue in the editor too even. I also read something about setting rigidbody.interpolation = RigidbodyInterpolation.Extrapolate; helping jagged movement resulting from physics out of sync. I didn’t actually try that myself though.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms