too much score points

I’m learning Unity for a few weeks and I’m totally new in this nice community. My Problem is, I have a falling Figure called “mermaid” and tagged with “fallingDown”. DestroyOnContacts works perfect.

voidOnTriggerEnter2D(Collider2Dother){
Destroy(GameObject.FindWithTag(“fallingDown”));
}

But i want to count how often the player catched the “mermaid”. My script is already counting, but it’s enough to move the player from left so right, instead of “catching” or touching it. Do you have any ideas what’s wrong?

This is the score script:
publicclassScoreScript:MonoBehaviour{
publicTextscoreText;
publicintmermaidValue;
publicboolIsTouching(Collider2Dcollider);
privateintscore;

voidStart(){
score=0;
UpdateScore();
}

voidOnTriggerEnter2D(Collider2Dother){
score+=mermaidValue;
UpdateScore();
}
}

void UpdateScore (){
scoreText.text =“Score:\n”+ score;
}
}

You don’t check if the collider the player hit was the mermaid indeed, so do other.gameObject.tag == “mermaid” or other.gameObject.name == “Mermaid” in the OnTriggerEnter

1 Like

Oh thank you. I already tried things like this:
void OnTriggerEnter2D (Collider2D other) {

if (GameObject.FindWithTag("fallingDown“)

but i never used other before the Object. Ah those little things…