Trigger 2D (another gameObject)

Hello, I want to create a 2D game , I have a problem, I want to do a “OnTriggerEnter2D” where the gameObject attach is not take and take another.
Exemple: the script is attached to the player, bullet enter in collision with another player. Sorry for my english, this is the code:

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

public class Player : MonoBehaviour {

    [SerializeField]
    private Stat health;

    [SerializeField]
    private Stat energy;

    [SerializeField]
    private Stat gems;

    private void Awake()
    {
        health.Initialize();
        energy.Initialize();
        gems.Initialize();


    }
  
    void OnTriggerEnter2D (Collider2D bullet)
    {
        if (bullet.gameObject.tag == "Bullet")
        {
            health.CurrentVal -= 10;
            Debug.Log("works");
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
            health.CurrentVal -= 10;
        }

        if (Input.GetKeyDown(KeyCode.A))
        {
            energy.CurrentVal += 10;
        }
        if (Input.GetKeyDown(KeyCode.E))
        {
            energy.CurrentVal -= 10;
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            gems.CurrentVal += 10;
        }
        if (Input.GetKeyDown(KeyCode.D))
        {
            gems.CurrentVal -= 10;
        }

    }


}

You don’t have understand my problem , my bullet is a trigger so I can’t change that.
Because of my script is attached to “player” I can’t associed more over than 2 gameobjects (principal(player) and other(bullet)) with the method “OnTriggerEnter2D”(and similar). I want detecte a collider2d with enemy and bullet and don’t change the sript’s place.

@AgarFun Do you want to damage the enemy upon bullet hit ? Is that right ?

If Object A collides with Object B, the collision message will be sent to both A and B, calling their OnCollisionEnter/OnTriggerEnter callbacks.

However, there is no way for Object C to listen for this collision. Only the objects involved in the collision itself will be notified.

You should replace OnTriggerEnter2D with OnCollisionEnter2D or OnCollisionStay2D. Hope this works!