How to store variables in start method

In my game I am trying to make it so the boss shoots objects at you and as soon as those objects spawn in I want them to get your position from that start frame and go towards it, so I don’t want it to follow the player but if the player doesn’t move then it will hit them. I had trouble with this as the object would continuously follow the player as the variable target kept changing event though I set it in the start method. Here is the script, please try to help me here :

public Transform target;
public GameObject player;
public float speed;
public float deathTime;

public void Start()
{
    player = FindObjectOfType<Player>().gameObject;
    target = player.transform;

    Invoke("EntityClear", deathTime);
}

public void Update()
{
    transform.position = Vector2.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
}

public void EntityClear()
{
    Destroy(gameObject);
}

private void OnTriggerEnter2D(Collider2D collision)
{
    if(collision.gameObject.tag == "Player")
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }
    if(collision.gameObject.tag == "Floor")
    {
        Destroy(gameObject);
    }
}

You are grabbing the player’s Transform which is a class that contains data about the player’s position. As the player moves around the scene, the data inside the class changes, so when you call target.position in your update method you will get the new, updated position values. Instead, grab the position out of the transform in the start method. The position is a Vector, which is a not a class but a struct, which is pass by value and therefore won’t change when you look at it again in your update, even if the position associated with the transform has changed. That is because pass by value types make a copy of the data when they read it, so that copy is preserved even when the original changes.
**
So instead, do something like this:

Vector3 playerPos;

Start(){
    playerPos = Player.transform.position;
}

Update(){
    //Move towards player pos
}

One more thing to note is that you probably don’t actually want the player position, you want the direction to the player. If you use the MoveTowards(playerPos), the projectile will stop at the position where the player was when it was fired. Instead I imagine you want the projectile to continue traveling in the same direction. So you can instead do something like

Vector3 direction;

Start(){
    direction = (Player.transform.position - this.transform.position).normalized;
}

Update(){
    transform.position += direction * speed * Time.deltaTime;
}