Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Update is called once per frame
- void Update () {
- CheckAbilityOne();
- }
- [Command]
- public void CmdUpdateHealth(float health)
- {
- UpdateHealth(health);
- }
- void UpdateHealth(float hp)
- {
- Debug.Log("hersky fersky new hp " + hp);
- }
- private void CheckAbilityOne()
- {
- if (timeBtwAttack <= 0)
- {
- if (Input.GetKeyDown(KeyCode.Alpha1))
- {
- timeBtwAttack = startTimeBtwAttack;
- anim.SetTrigger("Cleave");
- dmgAmount = cleaveDamage;
- Collider[] hits = Physics.OverlapSphere(transform.position, sphereRadius);
- foreach (Collider hit in hits)
- {
- if (!isLocalPlayer)
- {
- Debug.Log(hit.name);
- if (hit.tag == "Player")
- {
- print("hit " + hit.gameObject); // <-----------------
- Damage(hit.transform);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement