i made player attacks enemy with box collider and now I want to make the box collider appear when player starts attacking and box collider to disappear when he stops attacking is there some way to fix this or should I make it in different way
Here is script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HurtEnemy : MonoBehaviour
{
public int damageToGive = 2;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Enemy")
{
EnemyHealthManager eHealthMan;
eHealthMan = other.gameObject.GetComponent<EnemyHealthManager>();
eHealthMan.HurtEnemy(damageToGive);
}
}
}