I am having some trouble getting unity to do things in the order that I want them done. I have a fall damage system worked out, but it subtracts your health when you in the air. I don't understand how to make it apply the damage once you have hit the ground.
verticalMove = Vector2(rigidbody.velocity.y, 0);
if(verticalMove.magnitude > triggerFall)
{
var speed = verticalMove.magnitude;
var damage = damagePerFall * verticalMove.magnitude;
var otherScript : Health = GetComponent(Health);
otherScript.health -= damage;
}
↧