Rocket prefab dont follow an existing GameObject in the Game Scene

Hello, first I need to explain how my game works.

You are a Player (White circle) and a rocket spawn and follow a public target till it hits the target(the player) and destroy itself with help from a script.(All normal without any prefabs)

Then I created a GameObject with the name Spawner and the Spawner has a script to spawn a prefab every 3 seconds with help of youtube.

Then I make a prefab from my rocket and delete the 1 rocket from the Hierarchy. Then I add this rocket prefab to my Spawner.

My problem now is that

The rocket prefab doesn’t have any target because I can’t drag the Player from the Hierarchy in the target field. I could make a prefab from my Player and then add it to the target field but then my rocket doesn’t follow the player prefab in the game.

How could I make it that the rocket prefab that always spawn follow a non prefab GameObject(My Player)?

I hope that I described it well and everyone can understand my problem.

You could pass your player to the Spawner GameObject (the same way you did previously for the rocket). You can add some sort of setter (or with properties in C#) in the Rocket class, that will set the player (your target):

this.player = player;
}```

When you spawn a Prefab (in C#):

```var o = Instantiate(rocketPrefab, Vector3.zero, Quaternion.identity);
Rocket r = o.GetComponent<Rocket>();
r.SetPlayer(player);```

I hope I understood your problem.

Man I tried and tried but I have not much experience to do something in this shit, I will give up thx for helping.

I dont get the logic from C#