Answers for "how to make your health bar go down when a bullet hits your player unity"

0

how to make your health bar go down when a bullet hits your player unity

void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            TakeDamage(20);
        }
    }

    void TakeDamage(int damage)
    {
        currentHealth -= damage;

        healthbar.SetHealth(currentHealth);
    }
Posted by: Guest on February-16-2021

Code answers related to "how to make your health bar go down when a bullet hits your player unity"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language