private void Attack(Collider col) { Collider[] cols = Physics.OverlapBox(col.bounds.center, col.bounds.extents, col.transform.rotation, LayerMask.GetMask("Hitbox")); foreach (Collider c in cols) { if (c.transform.root == transform) { continue; } Debug.Log(c.name); switch (c.name) { case "Head": damage = headDamage; c.transform.root.GetComponent <Rigidbody>().AddExplosionForce(hitForce, transform.position, 10f); playAudio.PlayAttackSound(audioI); //Instantiate(Hit,transform.position,Quaternion.identity); break; case "Torso": damage = bodyDamage; c.transform.root.GetComponent <Rigidbody>().AddExplosionForce(hitForce * 0.80f, transform.position, 10f); playAudio.PlayAttackSound(audioI); //Instantiate(Hit, transform.position, Quaternion.identity); break; default: Debug.Log("Unable to indetify witch bodypart was hit. Check your spelling!"); break; } if (GameStaticValues.multiplayer) { c.transform.root.GetComponent <PlayerHealth>().TakeDamage(damage); } else { c.transform.root.GetComponent <BotHealth>().AddjustCurrentHealth(damage); } } }
// Stand light punch protected void StandLightPunch() { audioManager.PlayAttackSound(); CurrentlyAttacking(true); standLightPunchCurrently = true; }