Why does GameObject.FindWithTag not work in build, but works in editor

So, in my script, i have

im = GameObject.FindWithTag("InventoryManager").GetComponent<InventoryManager>();

and it finds the invenytorymanager in the editor. but in a build, it cant find anything. it is the same scene and everything

full script =

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DropperScript : MonoBehaviour
{
    public GameObject Ore;
    InventoryManager im;

    public float DropSpeed = 1;
    IEnumerator OreLoop()
    {
        while (true)
        {
            if (im.allOres.Count >= im.maxOres)
            {
                yield return null;
            }
            else
            {
                Drop();
                yield return new WaitForSeconds(DropSpeed);
               
            }
            
        }
        
    }
    void Drop()
    {
        Instantiate(Ore, transform.position, Quaternion.Euler(0, 0, 0));
    }
    // Start is called before the first frame update
    void Start()
    {
      
        im = GameObject.FindWithTag("InventoryManager").GetComponent<InventoryManager>();
        Debug.Log(im);
        StartCoroutine("OreLoop");
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

Same issue.