Nothing is doing damage and everything is passing through

For some reason the collision is not working. The game is a shooting-scroller, bullets pass through the enemies and the enemies pass through the player, and nothing is dealing damage. I just started to learn to code the other week so please help.

Bullet:

 public int damage = 10;
// ...
void OnTriggerEnter(Collider other)
{
    // Check if the bullet hits an enemy
    if (other.CompareTag("Enemy"))
    {
        // Damage the enemy and destroy the bullet
        other.GetComponent<EnemyController>().TakeDamage(damage);
        Destroy(gameObject);
    }
}

Enemy:

  public int damage = 10;
  public int health = 5;
// ...
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         // Damage the player when the enemy collides with them
         other.GetComponent<PlayerController>().TakeDamage(damage);
         Destroy(gameObject);
     }
 }

 public void TakeDamage(int damage)
 {
     health -= damage;

     if (health <= 0)
     {
         // Enemy defeated - drop coins and destroy the enemy
         DropCoins();
         Destroy(gameObject);
     }
 }

Player:

 private int health = 1;
// ...
 public void TakeDamage(int damage)
 {
     health -= damage;

     if (health <= 0)
     {
         // Handle death logic
         Debug.Log("Player died!");
     }
 }

In the collider on the gameobjects I have all marked with Is Trigger ☑.

if both Colliders are trigger, Objects pass through and no collision happens. I have highlighted a part from unity docs in the link. Untick the IsTrigger in your players collider and you should be good to go. Also you might need to change the OnTriggerEnter in your enemy script to OnCollisionEnter but i am not sure about that.

Also if you don’t want your enemy to move inside of your player you can just use colliders without making them triggers. Triggers do not stop objects from moving, they are pass-through. With your current code even after the fix i have given above, your enemy will move inside of your player since one of them is trigger. Untick all triggers and chenge your code to OnCollisionEnter Also If you want your enemy/player top take damage even after the first contact, look into OnCollisionStay.

Link: Unity - Scripting API: Collider.OnTriggerEnter(Collider).