Quantcast
Channel: Questions in topic: "melee"
Viewing all articles
Browse latest Browse all 201

melee system, does not apply the damage and two attacks

$
0
0
Hello everyone. my problem is that it does not affect the damage. I use boxcollider to apply it. and I would also like to find a way to activate a boxcollider using the left button, and another to keep the right button of the mouse, doing damage to all enemies within the collider. I hope you can help me. AudioSource audioSource; public int damage = 10; private Collider[] enemys; void Start () { audioSource = GetComponent(); } void OnCollisionEnter(Collider collision) { foreach (Collider enemy in enemys) { if (enemy.tag == "Enemy") { audioSource.Play(); HealthBar health = collision.gameObject.GetComponent(); health.TakeDamage(damage); } } } }

Viewing all articles
Browse latest Browse all 201

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>