When object A hits object B number go down

When object A hits object B I want to communicate this to a different script.
I have a script on one object that can identify being hit by another object with a bullet tag on it and a script that does damage that work individually but I don’t know how to communicate between them.

This feels like it should be something fairly simple or maybe its easier just to do it on one script?

public class Power : MonoBehaviour
{
public GameObject DoorE;
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == “Bullet”)
{
{
print(“DoDamagePls”);
}
}
}
}

//relevant part of other script

void Update()
{
if (Input.GetMouseButtonDown(1))
{
print(“DoingDamage”);
TakeDamage(20);

}
}

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

Definitely start with some tutorials on collisions and/or collections. There’s plenty!

Remember: code is only a tiny part of the problem. The much bigger part is setting up the scene properly.

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

How to understand errors in general: