My score system isn't working

I’m trying to make it so every time a bullet hits the square the score increases by one. When you successfully shoot a square the score flickers from 0 to 1 back to 0.

First Script:

using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Events;
using System;

public class changeTagWhenHit : MonoBehaviour
{
    public string bullet;
    public delegate void ShotAction();
    public static event ShotAction shot;
    public GameObject player;
    void OnTriggerEnter(Collider other)
    {
        if (player.gameObject.tag == "Unhit") 
        {
            if (other.gameObject.tag == bullet)
            {
                gameObject.tag = "Sugar";
                shot();
            }
        }
    }
}

Second Script:

using TMPro;
using UnityEngine;

public class ScoreAndEnd : MonoBehaviour
{
    public string UnhitTAG;
    public int score, highscore;
    public TextMeshProUGUI scoreText;
    public TextMeshProUGUI highscoreText;
    private void Start()
    {
        setScore();
    }
    void OnEnable()
    {
        changeTagWhenHit.shot += AddScore;
    }
    void AddScore()
    {
        score=score+=1;
    }
    void setScore()
    {
        scoreText.text = score.ToString();
    }
    void Update()
    {
        AddScore();
        setScore();
        if (score > highscore)
        {
            score = highscore;
        }
    }
}

Hi!

Once your score goes above your highscore (which starts out at zero), the score gets set to your highscore.

if (score > highscore)
{
    score = highscore;
}

This is something you probably don’t want, instead you probably want the highscore to get set to your score:

if (score > highscore)
{
    highscore = score;
}

Otherwise, your score will never go above zero (for more than a frame) and your highscore will be stuck at zero.

Hope this helps!