# Unity 6.3 LTS — Current Best Practices **Last verified:** 2026-02-13 Modern Unity 6 patterns that may not be in the LLM's training data. These are production-ready recommendations as of Unity 6.3 LTS. --- ## Project Setup ### Use Unity 6.3 LTS for Production - **Tech Stream** (6.4+): Latest features, less stable - **LTS** (6.3): Production-ready, 2-year support (until Dec 2027) ### Choose the Right Render Pipeline - **URP (Universal)**: Mobile, cross-platform, good performance ✅ Recommended for most games - **HDRP (High Definition)**: High-end PC/console, photorealistic - **Built-in**: Deprecated, avoid for new projects --- ## Scripting ### Use C# 9+ Features (Unity 6 Supports C# 9) ```csharp // ✅ Record types for data public record PlayerData(string Name, int Level, float Health); // ✅ Init-only properties public class Config { public string GameMode { get; init; } } // ✅ Pattern matching var result = enemy switch { Boss boss => boss.Enrage(), Minion minion => minion.Flee(), _ => null }; ``` ### Async/Await for Asset Loading ```csharp // ✅ Modern async pattern public async Task LoadEnemyAsync(string key) { var handle = Addressables.LoadAssetAsync(key); return await handle.Task; } ``` ### Use Source Generators for Serialization (Unity 6+) ```csharp // ✅ Source-generated serialization (faster, less reflection) [GenerateSerializer] public partial struct PlayerStats : IComponentData { public int Health; public int Mana; } ``` --- ## DOTS/ECS (Production-Ready in Unity 6.3 LTS) ### Use ISystem (Not ComponentSystem) ```csharp // ✅ Modern unmanaged ISystem (Burst-compatible) public partial struct MovementSystem : ISystem { public void OnCreate(ref SystemState state) { } public void OnUpdate(ref SystemState state) { foreach (var (transform, speed) in SystemAPI.Query, RefRO>()) { transform.ValueRW.Position += speed.ValueRO.Value * SystemAPI.Time.DeltaTime; } } } ``` ### Use IJobEntity for Parallel Jobs ```csharp // ✅ IJobEntity (replaces IJobForEach) [BurstCompile] public partial struct DamageJob : IJobEntity { public float DeltaTime; void Execute(ref Health health, in DamageOverTime dot) { health.Value -= dot.DamagePerSecond * DeltaTime; } } // Schedule it var job = new DamageJob { DeltaTime = SystemAPI.Time.DeltaTime }; job.ScheduleParallel(); ``` --- ## Input ### Use Input System Package (Not Legacy Input) ```csharp // ✅ Input Actions (rebindable, cross-platform) using UnityEngine.InputSystem; public class PlayerInput : MonoBehaviour { private PlayerControls controls; void Awake() { controls = new PlayerControls(); controls.Gameplay.Jump.performed += ctx => Jump(); } void OnEnable() => controls.Enable(); void OnDisable() => controls.Disable(); } ``` Create Input Actions asset in editor, generate C# class via inspector. --- ## UI ### Use UI Toolkit for Runtime UI (Production-Ready in Unity 6) ```csharp // ✅ UI Toolkit (replaces UGUI for new projects) using UnityEngine.UIElements; public class MainMenu : MonoBehaviour { void OnEnable() { var root = GetComponent().rootVisualElement; var playButton = root.Q