enemy attack unity 3d code example
Example: how to make enemy attack unity
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag == "Enemy")
{
Destroy(gameObject);
}
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag == "Enemy")
{
Destroy(gameObject);
}