Unity incluye herramientas para inspeccionar lo que ocurre durante el juego.

Debug.Log

Debug.Log("Mensaje");

Warning

Debug.LogWarning("Advertencia");

Error

Debug.LogError("Ocurrió un error");

Mostrar variables

Debug.Log($"Vida: {vida}");

Debug.DrawRay

Dibuja una línea temporal en la Scene View.

Debug.DrawRay(
    transform.position,
    transform.forward * 5f,
    Color.red
);

Muy útil para Raycasts.


Gizmos

Permiten dibujar ayudas visuales en el Editor.