Hey everyone, right now I’m trying to send a raycast from an enemy in the direction of my player but it seems the raycast is hitting the collider on my enemy and triggering.
Vector2 vecToPlayer = m_pTarget.transform.position - transform.position;
RaycastHit2D hit = Physics2D.Raycast(new Vector2(transform.position.x,transform.position.y),vecToPlayer);
if(hit.collider.gameObject==m_pTarget )
This is all I’m doing but currently hit.collider is equal to this.collider. Is there any way to ignore my collider?