hz-unity-code-review
Skill200 starsChanged 53 days agoApache-2.0View on GitHub
Reviews Unity code targeting Meta VR and Horizon OS for performance issues, rendering best practices, and common VR pitfalls. Use during code review or when diagnosing Meta VR performance problems in Unity projects.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mirzaaghazadeh/unity-meta-quest-skillsword for word, first seen Nov 15, 2026
Other versions1 project uses a version of this.
Word for word · 1
- mirzaaghazadeh/unity-meta-quest-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hz-android-2d-portingSkill
- hz-api-upgradeSkill
- hz-immersive-designerSkill
- hz-iwsdk-webxrSkill
- hz-metavrx-layout-sdkSkill
- hz-metavrx-ui-setSkill
- hz-new-project-creationSkill
- hz-perfetto-debugSkill
- hz-platform-sdkSkill
- hz-psdk-integrationSkill
- hz-quest-verify-firstSkill
- hz-react-native-expoSkill
- hz-simpleperf-debugSkill
- hz-spatial-sdkSkill
- hz-store-pwaSkill
- hz-store-submitSkill
- hz-unity-device-readinessSkill
- hz-unity-face-trackingSkill
- hz-unity-fbx-importSkill
- hz-unity-meta-core-sdkSkill
- hz-unity-meta-interaction-sdkSkill
- hz-unity-meta-mixed-reality-utility-kitSkill
- hz-unity-meta-movement-sdk-retargetingSkill
- hz-unity-meta-quest-uiSkill
- hz-unity-passthrough-camera-accessSkill
- hz-unity-placementSkill
- hz-unity-platform-sdkSkill
- hz-unity-project-analyzerSkill
- hz-unity-sdk-upgradeSkill
- hz-unity-tmp-resourcesSkill
- hz-vr-debugSkill
- hz-xr-simulator-controlSkill
- hz-xr-simulator-install-and-configureSkill
- metavr-cliSkill
- portalSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when reviewing Unity C# code or project settings that target Meta VR headsets.
- Distinctive: line 29
Single-pass multiview: must be enabled (Player Settings > XR Plug-in Management > Oculus > Stereo Rendering Mode)
- Distinctive: line 30
Vulkan: should be the primary graphics API
- Distinctive: line 32
HDR: should be disabled in URP asset settings
- Distinctive: line 33
Post-processing: should be minimal or disabled
- Distinctive: line 57
Use of URP/Lit or URP/Simple Lit instead of Standard shader
- Distinctive: line 60
No screen-space effects (SSAO, SSR, screen-space shadows)
- Very specific: line 94
Controllers: Use Unity's Input System Package for new projects (recommended).
- Distinctive: line 114
Use streaming load type for clips longer than 1 second
- Distinctive: line 223
Use device-side profiling to validate that code review findings translate to real performance improvements.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity Code Review for Meta VR
When to Use
Use this skill when reviewing Unity C# code or project settings that target Meta VR headsets. This includes:
- Reviewing scripts for VR performance issues
- Checking rendering pipeline configuration and settings
- Ensuring adherence to Meta VR-specific best practices
- Identifying common VR development pitfalls
- Validating input handling for controllers, hands, and eye tracking
- Auditing memory usage and GC allocation patterns
Key Review Areas
1. Rendering Pipeline Configuration
Meta VR applications must use the Universal Render Pipeline (URP) with specific settings optimized for mobile VR. The Built-in Render Pipeline is not recommended for new Meta VR projects.
Critical settings to verify:
- Single-pass multiview must be enabled (Player Settings > XR Plug-in Management > Oculus > Stereo Rendering Mode)
- Vulkan should be the primary graphics API
- Linear color space is required for correct lighting
- HDR should be disabled in URP asset settings
- Post-processing should be minimal or disabled
2. Draw Call Budgets and Batching
Meta VR has draw call budgets that vary by workload complexity. Every draw call has CPU overhead that directly impacts frame timing.
| Metric | Quest 2 / Quest Pro | Quest 3 / Quest 3S | Meta VR Glasses |
| Draw calls (busy simulation) | 80-200 | 200-300 | 200-300 |
| Draw calls (medium simulation) | 200-300 | 400-600 | 400-600 |
| Draw calls (light simulation) | 400-600 | 700-1000 | 700-1000 |
| Triangles per frame | 750K-1M | 1M-2M | 1M-2M |
| SetPass calls | < 50 | < 80 | < 80 |
Enable and verify:
- Static batching for non-moving geometry
- GPU instancing for repeated objects
- SRP batcher for URP materials
- Dynamic batching for small meshes (< 300 vertices)
3. Shader Complexity
Mobile GPUs on Meta VR cannot handle desktop-class shaders. Review all materials for:
- Use of URP/Lit or URP/Simple Lit instead of Standard shader
- Custom shaders that minimize texture samples and ALU operations
- Avoidance of real-time shadows where possible (bake instead)
- No screen-space effects (SSAO, SSR, screen-space shadows)
4. Memory Management
GC allocations cause frame hitches and must be eliminated from hot paths.
// BAD: Allocates every frame
void Update() {
string label = "Score: " + score.ToString();
var enemies = FindObjectsOfType<Enemy>();
var filtered = enemies.Where(e => e.IsAlive).ToList();
}
// GOOD: Zero allocations in Update
private StringBuilder _sb = new StringBuilder(32);
private List<Enemy> _enemyCache = new List<Enemy>();
private Enemy[] _enemyArray;
void Start() {
_enemyArray = FindObjectsOfType<Enemy>();
}
void Update() {
_sb.Clear();
_sb.Append("Score: ");
_sb.Append(score);
}5. Input Handling
Meta VR supports multiple input modalities. Code should handle:
- Controllers: Use Unity's Input System Package for new projects (recommended);
OVRInputis maintained for legacy support - Hand tracking:
OVRHandandOVRSkeletonfor hand pose data - Eye tracking:
OVREyeGaze(Quest Pro / Meta VR Glasses, requires permission) - Graceful switching between controller and hand tracking modes
6. Physics Configuration
Physics simulation is expensive on mobile. Review for:
- Physics timestep set to match target frame rate (72/90/120 Hz)
- Simplified collision meshes (use primitives, not mesh colliders)
- Reduced solver iterations (4-6 is usually sufficient)
- Layer-based collision matrix to minimize pair checks
- Rigidbody sleep thresholds configured appropriately
7. Audio Setup
Audio is often overlooked but can impact performance:
- Compress audio clips (Vorbis for music, ADPCM for short SFX)
- Use streaming load type for clips longer than 1 second
- Limit simultaneous audio sources (target < 16)
- Spatialize audio using Meta's audio SDK for 3D positioning
Quick Review Checklist
| Area | Target | Notes |
| Draw calls | 80-200 (busy) to 400-600 (light) | Use batching, instancing, atlasing |
| Triangles | 750K-1M/frame | Use LODs, occlusion culling |
| Texture resolution | Max 2K, 4K sparingly | ASTC compression required |
| Shader | URP mobile shaders | No Standard shader, no screen-space effects |
| Rendering mode | Single-pass multiview | Must be enabled in XR settings |
| FFR | Enabled (High or HighTop) | Fixed foveated rendering reduces edge fragment cost |
| MSAA | 4x quality / 2x perf | Free on tile-based GPU when configured correctly |
| Target frame rate | 72 Hz minimum | 90 Hz recommended, 120 Hz for smooth experiences |
| GC allocations | 0 B/frame in steady state | No allocations in Update/LateUpdate/FixedUpdate |
| Audio sources | < 16 simultaneous | Use pooling for audio sources |
What to Look For in Code
GC-Heavy Patterns
// Flag these patterns in code review:
Camera.main // Calls FindWithTag internally
GameObject.Find("name") // Linear search every call
GetComponent<T>() in Update // Cache the result
new List<T>() in Update // Allocates on heap
string + string in Update // Creates new string objects
foreach on non-List collections // Enumerator allocation
LINQ queries (.Where, .Select) // Multiple allocations
Boxing (int -> object) // Heap allocation
delegate/lambda in hot paths // Closure allocationUpdate() Misuse
// BAD: Empty Update still has overhead
void Update() { }
// BAD: Logic that doesn't need per-frame execution
void Update() {
SavePlayerPrefs(); // Should be event-driven
}
// GOOD: Use events, coroutines, or InvokeRepeating for non-per-frame logic
void OnScoreChanged(int newScore) {
UpdateScoreUI(newScore);
}Camera.main Anti-Pattern
// BAD: Camera.main uses FindWithTag internally
void Update() {
transform.LookAt(Camera.main.transform);
}
// GOOD: Cache the reference
private Transform _cameraTransform;
void Start() {
_cameraTransform = Camera.main.transform;
}
void Update() {
transform.LookAt(_cameraTransform);
}Find Calls in Hot Paths
// BAD: Expensive search every frame
void Update() {
var player = GameObject.FindWithTag("Player");
var rb = player.GetComponent<Rigidbody>();
}
// GOOD: Cache in Awake/Start or use dependency injection
private Rigidbody _playerRb;
void Awake() {
_playerRb = GameObject.FindWithTag("Player").GetComponent<Rigidbody>();
}Using metavr for Validation
You can use the metavr tool to validate builds and check device-side behavior. Invoke via metavr <args> (published as the npm package metavr; if metavr is not on PATH, run npx -y metavr <args>) — no install required.
# Check connected Meta VR device
metavr device list
# Install and run a build
metavr app install path/to/build.apk
metavr app launch com.company.app
# Check device logs for errors
metavr adb logcat --tag Unity
# Monitor GPU performance
metavr perf captureUse device-side profiling to validate that code review findings translate to real performance improvements.
Reference Documents
For detailed guidance on specific topics, see the following reference documents:
- Performance Checklist — comprehensive performance targets and optimization strategies
- Rendering Best Practices — Meta VR-specific rendering configuration and shader guidelines
- Input Handling — controller, hand tracking, and eye tracking implementation
- Common Pitfalls — frequently encountered mistakes and their fixes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

