(SOLVED)Sharing variables of a particular instance

I have a monster, which is instantiated multiple times.

Each one needs its own health value, which is altered from the gun shooting script.

Whats the best way to do this, I cant seemingly use drag and drop references, and I’m not sure I can use Get.Component or public variables, because I need to get the very particular variable for that instance of the creature.

I’m thinking I need something that comes off of the generated RayCast.Hit Collider as this is unique.

I worked it out so if anyone else has this question what I did was to:

  1. Create a function called reducehealth on the enemy

  2. Add this line of code to call that script, from the raycasting element

hit.collider.GetComponent(monsterMovement).reducehealth();