Setup guide
Unity | Best Practices: Mobile | 29
Best Practices: Mobile
This section provides simple guidelines to help your Android Unity app perform well.
Good performance is critical for all VR applications, but the limitations inherent to mobile development warrant
special consideration.
Please review “Performance Advice for Early Titles” in Design Guidelines and Mobile VR Design and
Performance Guidelines before reading this documentation - they may be found in the Mobile SDK
documentation..
General CPU Optimizations
To create a VR application or game that performs well, careful consideration must be given to how features are
implemented. Scene should always run at 60 FPS, and you should avoid any hitching or laggy performance
during any point that the player is in your game.
• Be mindful of the total number of GameObjects and components your scenes use.
• Model your game data and objects efficiently. You will generally have plenty of memory.
• Minimize the number of objects that actually perform calculations in Update() or FixedUpdate().
• Reduce or eliminate physics simulations when they are not actually needed.
• Use object pools to respawn frequently-used effects or objects instead of allocating new ones at runtime.
• Use pooled AudioSources versus PlayOneShot sounds, as the latter allocate a GameObject and destroy it
when the sound is done playing.
• Avoid expensive mathematical operations whenever possible.
• Cache frequently-used components and transforms to avoid lookups each frame.
• Use the Unity Profiler to identify expensive code and optimize as needed.
• Use the Unity Profiler to identify and eliminate Garbage Collection allocations that occur each frame.
• Use the Unity Profiler to identify and eliminate any spikes in performance during normal play.
• Do not use Unity’s OnGUI() calls.
• Do not enable gyro or the accelerometer. In current versions of Unity, these features trigger calls to
expensive display calls.
• All best practices for mobile app and game development generally apply.
Note: The Unity Profiler is not available for Unity Free.
Rendering Optimization
While building your app, the most important thing to keep in mind is to be conservative on performance from the
start.
• Keep draw calls down.
• Be mindful of texture usage and bandwidth.
• Keep geometric complexity to a minimum.
• Be mindful of fillrate.










