Script working with one object but not others.

I’m trying to make a bomb, that once picked up will start ticking and the only way to turn it off is to by get rid of it entirely; you do so by standing on top of these “Station” that take it away and turn it off. Right now I have it working as it should, but it only does so for the LAST bomb object placed. I have one script for the bombs sitting in each bomb, and one script for the stations sitting in each station.

I’m a beginner, and I’m not sure about the scope of this problem, but I’ve tried to make an array but had no luck 'cause I didn’t know how to. Right now I’m thinking the problem might be with “FindObjectOfType” because I think it only takes an instance of an object and not ALL instances.

Code for the bomb:

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

public class Bomb : MonoBehaviour
{
    private Animator anim;
    public Transform bomb;
    public GameObject player;

    public Vector3 Offset;
    public bool Triggered = false;
    public bool ShouldTrackPlayer = false;

    public float ExplsnCldwnFrames;
    private float timer;
    private void Awake()
    {
        anim = GetComponent<Animator>();

        ExplsnCldwnFrames /= 12;
        timer = ExplsnCldwnFrames;
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            ShouldTrackPlayer = true;
            Triggered = true;
        }
    }
    private void Update()
    {
        if (ShouldTrackPlayer)
        {
            anim.SetBool("BombIsTicking", true);
            bomb.transform.position = player.transform.position + Offset;

            timer -= Time.deltaTime;
        }

        if (!ShouldTrackPlayer && Triggered)
        {
            Debug.Log("shouldn't track player");
            anim.SetBool("BombIsTicking", false);
            timer = ExplsnCldwnFrames;
            Triggered = false;
        }
    }
    private void RespawnPlayer()
    { //called in animator
        FindObjectOfType<Health>().GameOver();
    }
}

Code for the station:

using UnityEngine;
public class ClearEffectStation : MonoBehaviour
{
    public Transform BombLocation;
    private Bomb bomb;
    private void OnTriggerStay2D(Collider2D collision)
    {
        if (FindObjectOfType<Bomb>().Triggered
            && collision.tag == "Player")
        {
            FindObjectOfType<Bomb>().ShouldTrackPlayer = false;
            Debug.Log("BombTransfered");
            FindObjectOfType<Bomb>().bomb.transform.position = BombLocation.transform.position;
        } 
        //I'm pretty sure the "FindObjectOfType" is the problem. I think it only takes one instance from a script instead of all.
    }
}

FindObjectOfType only returns one object. Try using FindObjectsOfType instead. That will return an array.

    public Transform BombLocation;

    private void OnTriggerStay2D(Collider2D collision)
    {

        if (collision.tag == "Player")
        {
        Bomb[] bombs = FindObjectsOfType<Bomb>();
            foreach (Bomb bomb in bombs)
            {
                if (bomb.Triggered)
                {
                    bomb.ShouldTrackPlayer = false;
                    bomb.transform.position = BombLocation.transform.position;
                }
            }
        }
    }

There’s no need to have a reference to the bomb’s own Transform in the script for the bomb.

Sorry for the long delay. Was working on something different in the meantime and didn’t see your reply. Works perfectly, thanks. @rafael_unity386