create speed booster c#

I’m creating a runner game where the player gets a speed boost after running into a ‘boost coin’
this is what i have so far, but it’s not working. can anyone help me?

public class Booster : Coin
{

public float bonusTime;
public float bonusGain = 500f;
private bool picked = false;
private float timer = 20f;

void  OnTriggerEnter(Collider other)
{
    if (other.gameObject.tag == "Player")
    {
        picked = true;
        GameObject.FindGameObjectWithTag("Player").GetComponent<ControlRunner>().speedRunner += bonusGain;
        Destroy(gameObject);
    }
}

void Update()
{
    if (picked == true)
    {
        timer += Time.deltaTime;
        if (timer >= bonusTime)
        {
            GameObject.FindGameObjectWithTag("Player").GetComponent<ControlRunner>().speedRunner -= bonusGain;
            Destroy(gameObject);
        }
    }
}

}

Your ControlRunner might not properly be registering this.

ASSUMING your ControlRunner script is working correctly (you should post it) the collision isn’t being detected. This can happen if you are changing the position of the obejcts around you while using a rigibody, but without further info, I won’t delve into that.

Also, if you destroy the coin in the triger event, the entire

 if (picked == true)

loop will not EVER execute.