Answers for "unity 3d shooting cooldown"

C#
3

unity 2d shooting cooldown

// Very light and easy to use cooldown tool for unity:
// https://github.com/JosepeDev/CooldownAPI

void Shoot()
{
  // some shooting behaviour
  ...
  // cooldown activation
  shootingCooldown.Activate();
}

if (//if player is pressing the shoot button)
{
  // prevent the player from shooting when cooldown active
  if (shootingCooldown.IsActive == false)
  {
    Shoot();
  }
}
Posted by: Guest on August-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language