Scene View Debugging
- Debug.DrawLine(): Visualize connections & paths
- Debug.DrawRay(): Show raycasts & sight lines
- OnDrawGizmos(): Always visible scene markers
- OnDrawGizmosSelected(): Selected object markers
Performance Profiling
- ProfilerMarker: Modern, low-overhead profiling
- Profiler.BeginSample: Legacy but flexible
- Editor Profiler Window: Deep performance analysis
Physics Debugging
- Physics.IgnoreCollision(): Ignore collisions between specific objects
- Physics.OverlapSphere(): Check for objects in a given radius
Network & Input Debugging
- Application.internetReachability: Check network connectivity
- SystemInfo.deviceName: Log the current device’s name
- Input.GetKeyDown(): Track keypresses during gameplay
- Input.mousePosition: Log mouse position for UI debugging
Pro Tips:
- Never leave Debug.Logs in production builds
- Use conditional compilation for debug code
- Keep Gizmos clean and organized
- Profile specific sections, not entire methods
Common Mistakes:
- Debug spam in Update() methods
- Forgetting to remove debug code
- Not cleaning up profiler markers
- Over-relying on console logs