Variables from one script to another.

My code doesn’t show any errors, but doesn’t take health away. The point is that if my fireBall collides with an enemy the enemy loses as much health as there is damage. here’s the script :

 void OnTriggerStay(Collider other)
     {
         if (other.GetComponent<removeHealth>())
             other.GetComponent<removeHealth>().health -= damage;
     }

and yes I have an object that has a script removeHealth active. removeHealth also has a public health float in it.

Try to store damage variable in fireBall and health variable in enemy when it collides with the enemy try this
health -= other.damage;

Please check if you have non-Kinematic Rigidbody attached to one of the colliding objects. I guess you are missing Rigidbody.

@Dhicci
If you’re using “Trigger”, make sure “Is Trigger” is checked on the “other”, but I would suggest using OnCollisionEnter(Collision col).
Also before actually taking the health away, to make sure that collision actually occurs, try Debug.Log(“Collided”);