项目符号正在与触发器碰撞

时间:2019-04-24 19:05:56

标签: c# unity3d game-physics

所以我做了子弹,但它不断与地图的触发点发生冲突

void OnTriggerEnter2D(Collider2D collision)
{
   Enemy_Health enemy =  collision.GetComponent<Enemy_Health>();
    if(enemy != null )
    {
        enemy.TakeDmg(damage);
    }
    Destroy(gameObject);

}

0 个答案:

没有答案