How to get continuous reference to a GameObject's position?

Say, its a 2D word falling typing game, the words are individual GameObjects. How do I check the y position of each word GameObject falling down the scene and then trigger the Game Over text when it passes a certain y position?


Word GameObject Prefab

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[System.Serializable]
public class Word {

	public string word;
	private int typeIndex;
	WordDisplay display;

    public Word (string _word, WordDisplay _display)
	{
		word = _word;
		typeIndex = 0;
		display = _display;
		display.SetWord(word);
	}

	public char GetNextLetter ()
	{
		return word[typeIndex];
	}

	public void TypeLetter ()
	{
		typeIndex++;
		display.RemoveLetter();
	}

	public bool WordTyped ()
	{
		bool wordTyped = (typeIndex >= word.Length);
		if (wordTyped)
		{
			display.RemoveWord();
		}
		return wordTyped;
	}

    void Update()
    {
        if(Transform.position.y == -328.1865)
        {
            GameOver.turnon = true;
        }
    }
}

Event script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GameOver : MonoBehaviour
{
    public Text gameOverText;
    public static bool turnon;
    // Start is called before the first frame update
    void Start()
    {
        gameOverText = GetComponent<Text>();
        gameOverText.gameObject.SetActive(false);
        turnon = false;
        
    }
    void Update()
    {
        if (turnon == true)
        {
            gameOverText.gameObject.SetActive(true);
        }
        
    }
}

HEllo.

I did not read the code, but for your question, I think is better to use a collider to detect when a word reaches a “zone” to be deleted.

Also for your question i see you are pretty new at Unity/scripiting. I strongly recommend to spend 4-5 hours waching some basic tutorial about colliders, about gameobjects, etc…

Good luck!

// Word.cs
void Update()
{
if(display.transform.position.y <= -328.1865f )
{
GameOver.turnon = true;
}
}

// WordManager.cs
void Update()
{
    foreach( Word word in words)
       word.Update();
}