void Attack() { if (attackTimer <= 0) { /* * Debug.Log(gameObject.name + " attacked."); * attackTimer = 0.0f; * * RaycastHit melee = new RaycastHit(); * if (Physics.Raycast(cam.transform.position, cam.transform.forward, out melee, 5.0f)) * { * Debug.DrawLine(cam.transform.position, melee.transform.position, Color.cyan, 10f); * CmdDoDamage(melee.transform.gameObject, statistics.attack); * } OLD */ Inventory i = GetComponent <Inventory>(); attackTimer = i.ATK(); } }