My bullet sprites change on air when i shoot to other direction help

so i have a player who shots in 4 directions but when i change the direction to shoot from left to up for example, the bullets that have already fired change the sprite too. help

bullet code:

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

public class BulletController : MonoBehaviour
{
public float lifeTime;

public Sprite grapa;
public Sprite grapa2;
public Sprite grapa3;
public Sprite grapa4;

// Start is called before the first frame update
void Start()
{
    StartCoroutine(DeathDelay());
}

// Update is called once per frame
void Update()
{
    if (Input.GetKey(KeyCode.LeftArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = grapa;
    }
    else if (Input.GetKey(KeyCode.RightArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = grapa2;
    }
    else if (Input.GetKey(KeyCode.DownArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = grapa3;
    }
    else if (Input.GetKey(KeyCode.UpArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = grapa4;
    }
}

IEnumerator DeathDelay()
{
    yield return new WaitForSeconds(lifeTime);
    Destroy(gameObject);
}

void OnTriggerEnter2D(Collider2D col)
{
    if(col.tag == "Enemy")
    {
        Destroy(gameObject);
        col.gameObject.GetComponent<EnemyController>().Shot();
    }
}

}

player code:

using UnityEngine;
using UnityEngine.UI;

public class Player : MonoBehaviour
{

public float speed;
Rigidbody2D rigidbody;

public GameObject bulletPrefab;
public float bulletSpeed;
private float lastFire;
public float fireDelay;
public float damage;
public Sprite BTSplayer1;
public Sprite BTSplayer2;
public Sprite BTSplayer3;
public Sprite BTSplayer4;
public Sprite shoot1;
public Sprite shoot2;
public Sprite shoot3;
public Sprite shoot4;

public BulletController ProjectilePrefab;
public Transform LaunchOffSet;

// Start is called before the first frame update
void Start()
{
    rigidbody = GetComponent<Rigidbody2D>();
}

// Update is called once per frame
void Update()
{
    float horizontal = Input.GetAxis("Horizontal");
    float vertical = Input.GetAxis("Vertical");

    float shootHor = Input.GetAxis("ShootHori");
    float shootVer = Input.GetAxis("ShootVert");
    if((shootHor != 0 || shootVer != 0) && Time.time > lastFire + fireDelay)
    {
        lastFire = Time.time;
        Shoot(shootHor, shootVer);
        
    }

    if (Input.GetKey(KeyCode.LeftArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = shoot2;
    }
    else if (Input.GetKey(KeyCode.RightArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = shoot1;
    }
    else if (Input.GetKey(KeyCode.DownArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = shoot3;
    }
    else if (Input.GetKey(KeyCode.UpArrow))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = shoot4;
    }

    else if(Input.GetKey("a"))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = BTSplayer1;
    }
    else if(Input.GetKey("d"))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = BTSplayer2;
    }
    else if (Input.GetKey("s"))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = BTSplayer3;
    }
    else if (Input.GetKey("w"))
    {
        this.gameObject.GetComponent<SpriteRenderer>().sprite = BTSplayer4;
    }

    rigidbody.velocity = new Vector3(horizontal * speed, vertical * speed, 0);

}

void Shoot(float x, float y)
{
    GameObject bullet = Instantiate(bulletPrefab, LaunchOffSet.position, transform.rotation);
    bullet.AddComponent<Rigidbody2D>().gravityScale = 0.25f;
    bullet.GetComponent<Rigidbody2D>().velocity = new Vector3(
        (x < 0) ? Mathf.Floor(x) * bulletSpeed : Mathf.Ceil(x) * bulletSpeed,
        (y < 0) ? Mathf.Floor(y) * bulletSpeed : Mathf.Ceil(y) * bulletSpeed,
        0
        );
}

}

It’s the Update method on BulletController, it has input logic in it, each bullet has that script on it so they all be subject to the inputs the player uses. You should be setting all that in the Shoot method of your Player script and removing the Update method from your bullet controller altogether. The way you are doing it now, during each frame every instance of BulletController is checking for input and applying it to every bullet object, this is really inefficient. you should never be setting something to the same value during update, you just set it once somewhere else, Start, Awake, OnEnable, or a method from another script.

Also you do not need to use the ‘this’ keyword before using gameObject, gameObject is a reference to the object the script is attached to.