So i have an enemy: has boxCollider for Range(this one is a trigger) and sphere collider for taking hits. NO rigidbody on it. Then i have a player with a boxCollider for range(also a trigger) and a sphere collider for taking hits and also has a rigidbody. My problem is when the range enemy is within range of attacking the player the player is far away from the enemy but if i attack with the player the players boxCollider triggers with the enemies range box collider and the players melee attack does damage due to this. Is there anyway i can avoid these 2 range checker colliders triggering each other?
So I kind of found a fix if anyone was interested. Before i actually deal damage to the enemy my collider is touching i just check if the distance between the player and the enemy is <4f which is perfect for my melee player. So even though my trigger is registering the enemies range checking collider my player still cant do damage to something out of range.