I cant find my Player per Script

Hey guys
i tried like 10 different ways to find my player per script but it dosent work every time there is no error but it dosent work.
This are my 2 codes can you help me ?

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

public class PickUpItem : MonoBehaviour
{


    Transform player;
    [SerializeField] float speed = 5f;
    [SerializeField] float pickUpDistance = 1.5f;
    [SerializeField] float ttl = 10f;

    private void Awake()
    {
        player = GameManager.instance.player.transform;
    }

    private void Update()
    {
        ttl -= Time.deltaTime;
        if(ttl < 0)
        {
            Destroy(gameObject);
        }

        float distance = Vector3.Distance(transform.position, player.position);
            if(distance > pickUpDistance)
        {
            return;
        }
        transform.position = Vector3.MoveTowards(
            transform.position,
            player.position,
            speed * Time.deltaTime
            );

        if(distance < 0.1f)
        {
            Destroy(gameObject);
        }

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

public class GameManager : MonoBehaviour
{

    public static GameManager instance;

    public GameObject player;

    private void Awake()
    {
        instance = this;
    }
}

Maybe the awake function on pickupitem is being called before the gamemanager’s awake? does it work if u change the awake in pickupitem to start()?

It worked but only when the GameObject with the scirpt was in the scene since the start of the scene but i dosent work if the GameObject with the PickUpItem Script appears when i clicked Left Mouse Button

mmh i tried the code and for me it works for both pre existing and added objects.

are u instantiating a new pickupitem from a prefab?
does it fail to find the player again or is it something else?

Hey this is the code for instantiating the item
and ingame there are no errors

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

public class TreeCuttable : ToolHit
{

    [SerializeField] GameObject pickUpDrop;
    [SerializeField] int dropCount;
    [SerializeField] float spread = 0.7f;

    public override void Hit()
    {
        dropCount = Random.Range(3, 7);

        while (dropCount > 0)
        {
            dropCount -= 1;

            Vector3 position = transform.position;
            position.x += spread * UnityEngine.Random.value * spread / 2;
            position.y += spread * UnityEngine.Random.value * spread / 2;
            GameObject go = Instantiate(pickUpDrop);
            go.transform.position = position;
        }

        Destroy(gameObject);
    }
}

works fine for me, i dont see anything wrong with the code either.
maybe someone else knows more.

Okay but thx for the help man