unity 3d fire shoting

53

unity 3d fire shoting -

private void OnTriggerEnter(Collider other)
{
    if (other.CompareTag("Enemy"))  
    {
        // Destroy the thing tagged enemy, not youself
        Destroy(other.gameObject);

        // Could still destroy the bullet itself as well
        Destroy (gameObject);
    }
}

Comments

Submit
0 Comments