Trying to spawn object at another objects location with key press?

I’m trying to spawn the players bullet at where to player is but pressing space but its not working and I’m only getting the error that PlayerSpaceShip hasn’t been assigned. when to my knowledge I’m just referencing the player so i can give the bullet a spawn location.

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

public class BulletSpawn : MonoBehaviour
    public float BulletSpeed = 10f;
    public GameObject PlayerBullet;
    public GameObject PlayerSpaceShip; 
    void Update()
        var ObjectSpawnPosition = PlayerSpaceShip.transform.position + (PlayerSpaceShip.transform.forward * 2f);

        if (Input.GetKeyDown(KeyCode.Space))
            Instantiate(PlayerBullet, ObjectSpawnPosition, Quaternion.identity);
            PlayerBullet.transform.Translate(Vector2.up * BulletSpeed * Time.deltaTime);


Try changing it to the following

GameObject newBullet = Instantiate(PlayerBullet, ObjectSpawnPosition, Quaternion.identity);
newBullet.transform.Translate(Vector2.up * BulletSpeed * Time.deltaTime);