* I also noticed that you're both using a non-Kinematic rigidbody, and also translating manually via update, that can cause transform sync issues. This won't affect much right now, but your gameplay objects shouldn't be adjusting application settings, and on top of that if you can avoid your instanced objects doing any logic, you should do so. * I noticed your TestObject script has the FPS override, you should probably move that into TestManager. I'll see if I can get to that tomorrow, but I doubt a mobile performance gap would still explain the issue.
* I wasn't able to test against my galaxy S7 tonight, since I had to replace a failing hard drive a few months ago and forgot to reinstall the android dev tools. Like most frames in the editor are WaitForTargetFPS, which is normally pretty good, as that means editor overhead and VSync are your biggest framepace constraints. I still noticed some hiccuping, which tells me this is some kind of sync issue and less a raw perf issue. I have a GTX 970 and an i7 4770k with 16 GB. * In the editor, almost all of the performance issue hiccups at all is entirely VSync + editor overhead for the majority of frames.
Even with the deep profiler most of your code runs in less than 3ms because there's not much going on. Obviously you've stripped it down for this sample but there's not much going on that your code is doing.
Having a look at this and running the deep profiler, it looks like it's partially that you're stuck with VSync and there's some hiccuping with that in the editor. You may also want to consider using a manager-type updater class that will apply your car movement to all car scripts at once, instead of relying on the normal Update() / FixedUpdate() script calls.
Secondary animations, non-essential things like UI tween effects can run at update speeds and stutter is acceptable, even if not preferred.
This article goes into where micro-stuttering can occur, even in a seemingly "optimized" deltaTime update loop, even on beefy PC recommendation continues to be that if you have important gameplay movement, even if it uses kinematic or custom physics, it should still use the FixedUpdate() loop timing. Only other thing I can think of to do without diving into your project (I'm at work) is to look at creating a build with deep profiling enabled or use the Profiler.Begin/EndSample() functions for slices of code you think may be the culprit. If you need your physics to update lock-step, in a stable manner, try converting your movement logic to use fixed timestep intervals (you'll need to set your fixed time step to your target framerate in the editor or via a startup script) and migrate your logic to FixedUpdate() using Time.fixedDeltaTime instead of ltaTime. Unity remote is just casting the screen onto your device and use the device input to hand it back to the editor. If it reaches a certain Y point, reset it back to the top. If I were making an endless runner like that I'd move 2 or 3 road pieces. You're currently moving the texture using a textureoffset, not sure how precise that is and whether it has an effect when you increase the texture offset by such a high amount (since it builds up every frame). If there is no car available from the pool instantiate one.
While running -> get a car from the pool (set active) -> track its life cycle (position) -> if end of life cycle (out of screen bounds) -> return to the pool (set inactive) Rather on start, instantiate a few to fill the pool a bit by an initial amount. You don't want to constantly keep instantiating prefabs again and again.
It isn't the same experience as building the APK for the target device.Īs Shayke said in an endless runner it is highly advisable to use object pooling. Personally I never use the Unity Remote because it just buggy and sucks. Click to expand.Unity remote is just casting the screen onto your device and use the device input to hand it back to the editor.