Game not functioning in build

I made a game but some of the scripts don’t work when i build it but there are no error. One of the scripts that don’t work are the Enemy script. The enemies won’t split into two more enemies can anyone tell me why here’s the script

using UnityEngine;

public class Enemy : MonoBehaviour
{
    // public
    public CameraShake camShake;
    public GameObject smallSplitter;
    public ParticleSystem ps;
    public float duration;

    // private

    GameObject player;
    SoundManager sm;

    // void

    void Start() 
    {
        player = GameObject.FindGameObjectWithTag("Player");
        camShake = Camera.main.GetComponent<CameraShake>();
        sm = GameObject.FindGameObjectWithTag("SM").GetComponent<SoundManager>();
    }

    void OnCollisionEnter2D(Collision2D other) 
    {
        if (other.collider.tag == "Player") 
        {
            // death
            Destroy(this.gameObject);
            sm.DeathS();
            // boost up
            player.GetComponent<Rigidbody2D>().AddForce(new Vector2(0f, 5f), ForceMode2D.Impulse);
            // split
            Instantiate(smallSplitter, transform.position + transform.forward * 2, transform.rotation);
            Instantiate(smallSplitter, transform.position + transform.right * 2, transform.rotation);
            // Score
            Score.playerScore += 15;
            //shake
            camShake.Shake(duration);
            // particles
            Instantiate(ps, transform.position, Quaternion.identity);
            // health
            player.GetComponent<PlayerHealth>().numOfHearts += 1;
        }
    }

}

Add debugging to figure out where the failure is occurring.

I’m not sure if it matters, but you’re calling Destroy before you then go on to use other values in this class, such as its transform. I don’t recall whether Unity cares about that, and I think it might only destroy at the end of the frame, but I’d just move that to the end of the method anyway.