I recently added Brackey’s health bar into my game. I wanted to change from pressing a button to show damage to having an enemy’s projectile deal damage.
These are the line of code I want to change.
if (Input.GetKeyDown(KeyCode.Space))
{
TakeDamage(20);
}
(I’m new to coding… excuse my noob like behavior),I recently added Brackey’s health bar to my game, I was wonder how I could make one of my enemy projectile damage the player. instead of pressing a button.
I’m looking to replace this
if (Input.GetKeyDown(KeyCode.Space))
{
TakeDamage(20);
}