I have a public float (which is a timer that decreases) in another script that I want to add a value to through a powerup. The code that I’ve implemented doesn’t seem to do anything.
I was using this tutorial: A Great Way To Setup POWERUPS In Your Unity Game - YouTube
It worked for another powerup, that is an integer, but not for this.
[CreateAssetMenu(menuName = “PowerUps/AddTime”)]
public class AddTime : PowerupEffect
{
public float increase;
public override void Apply(GameObject target)
{
target.GetComponent().startingTime += increase;
Debug.Log(“Added Extra Time!”);
}
}