Failure to pass in a game object into an instatiated game object

Hello!
I am having an issue where I am making an agar.io-esque game where the player’s sprite follows the mouse cursor. The enemies are spawned at random locations and seek after the player. So far, player movement and enemy spawning is working fine. The issue I think is something to do with not being able to pass in the player sprite object into the script for “chasing” it.

I have the follow code for spawning the enemies.

public class Spawner : MonoBehaviour
{
public GameObject enemy;
[SerializeField] private float Speed = 2f;

void Start()
{
    InvokeRepeating("Generate_Enemy", 0, Speed);
}
void Generate_Enemy()
{
    int x = Random.Range(0, 900);
    int y = Random.Range(0, 500);
    Vector2 Target = Camera.main.ScreenToWorldPoint(new Vector2(x, y));

    Instantiate(enemy, Target, Quaternion.identity);
 }

}

The spawning works fine. The issue comes in when I try to make the enemies attracted to the player’s sprite. They all seem to be attracted to the starting point. I have attempted to update the player position every tick, but it doesn’t seem to work.

Here is my “chase” class

public class Chase : MonoBehaviour
{
[SerializeField] private GameObject thePlayer;
[SerializeField] private float speed = 1.5f;

void Update()
{
    float step = speed * Time.deltaTime;
    transform.position = Vector2.MoveTowards(transform.position, thePlayer.transform.position, step);
}

}

I think the problem lies in the unity interface. When I go to drag the player object into the slot for the enemy prefab, it doesn’t let me, despite it being designated as a game object and it allows all other game objects to fill the slot. It just gives a red circle with a line on it.

When I make an enemy object at the start, it works fine and takes in the player object no problem. But when the spawner script instatiates a new one, it forgets how to find the player again. Thoughts?

I am not a complete newb to Unity or C#, but it may be something simple. Please help

I figured out how to do it. I needed to avoid passing the object in via the Unity interface and bypass that entirely using the FindObjectByType() method. I made a new class “Player” and stored its x and y positions in their own variables that then updated their values every update tick. then, when I needed those values for the enemy movement and pointing toward the player, I referenced the values being updated in Player, not the vector2 values of the player object. Now it works perfectly. Just had to lean on my OO programming knowledge and not my Unity knowledge. Thank you @dcmrobin for trying to help. I really appreciate it!