Buen tutorial! Gracias.
Lo de la velocidad lo podrias hacer usando el mismo controller sin necesidad del trigger, y guardando la velocidad previa asi haces la comparacion. Algo asi:
Lo de la velocidad lo podrias hacer usando el mismo controller sin necesidad del trigger, y guardando la velocidad previa asi haces la comparacion. Algo asi:
if (m_controller.isGrounded)
{
if (previousYVelocity > 10)
m_health.Kill ();
else if (previousYVelocity > 9)
m_health.SetDamage (50);
else if (previousYVelocity > 7)
m_health.SetDamage (25);
previousYVelocity = 0;
}else{
previousYVelocity = Mathf.Abs (m_controller.velocity.y);
}