C# score not updating

I am learning C#…

I have 2 scripts. One is on a pickup item ( a Heart object that adds points on pick up )
& an inventory script is attached to my main character … each object has a collider.

For some reason my score is not updating when I pick up a heart…
I believe " c.gameObject.SendMessage(“PickUpHealth”, c); " in the Health.cs script is not calling function PickUpHealth…

So my question is why ??

here are both scripts

public class Health : MonoBehaviour {
	
	public float rotationSpeed = 100.0f;
	public AudioClip powerSound;
	public UILabel  guiLevel;
	public float itemValue; 
	
		
	void OnTriggerEnter (Collider c) {
		
		if (c.gameObject.tag == "Player") {
		Debug.Log("HELLO");
	    c.gameObject.SendMessage("PickUpHealth", c);
	    AudioSource.PlayClipAtPoint (powerSound, transform.position);
		Destroy(gameObject);			
		}
    }
}

// My Character Inventory SCRIPT

public class Inventory : MonoBehaviour {

public static int powerup = 0;
public AudioClip powerSound;
private GameObject itemPowerup;
private float score;

public UILabel  guiLevel;

void Start () {
score = 1.0f;
}
	
void PickUpHealth(Collider c){
	if(c.CompareTag("heart")) {
		Debug.Log (" Eddie collided with a heart ");
	    score += c.gameObject.GetComponent ().itemValue;
		guiLevel.text = "Score: " + score;	
       // AudioSource.PlayClipAtPoint (powerSound, transform.position);
		//Destroy(gameObject); 
        }
    }

}

I don’t understand how you want to do this but I’d do it this way:

public class Health : MonoBehaviour {
    
    public float rotationSpeed = 100.0f;
    public AudioClip powerSound;
    public UILabel guiLevel;
    public float itemValue;
    
    
    void OnTriggerEnter (Collider c) {
    
        if (c.gameObject.tag == "Player") {
            Debug.Log("HELLO");
            Inventory InvScript = c.gameObject.GetComponent("Inventory") as Inventory;
            InvScript.score ++;
            AudioSource.PlayClipAtPoint (powerSound, transform.position);
            Destroy(gameObject);
        }
    }
}

OFC this inventory script HAS to be on a gameObject with tag Player

public class Inventory : MonoBehaviour {

    public static int powerup = 0;
    public AudioClip powerSound;
    private GameObject itemPowerup;
    public float score; // HAS TO BE PUBLIC
    
    public UILabel guiLevel;
    
    void Start () {
        score = 1.0f;
    }
}

OFC don’t forget to set score to public otherwise you can’t access it.

I’m sorry if I couldn’t answer your Q for the .SendMessage but I’ve never used that and don’t know what it does

but this way should work let me know if you run in to any errors

Edited the A