CodingGuy
CodingGuy

Reputation: 11

A Enemy Prefab with two different hitboxes both detect and take damage from bullets in unity

I made a enemy prefab and a object to it (Field of View).

The enemy has a Box Collider 2D and a Rigidbody 2D, the FOV only has Box Collider 2D.

The enemy checks if a bullet is hitting him and takes damage from the bullets.

My problem is that he gets double the damage he should normally get, because the FOV seems to detects the bullet too. But the FOV Object doesn't have the script for the detection but detects it anyways.

I disabled the Box Collider 2D and the enemy got the normal damage. But that is not a real solution. I looked if the FOV had the accidentally the same script as the enemy, but that is not the case.


What's the reason for that? Thanks in advance!

Upvotes: 1

Views: 166

Answers (0)

Related Questions