Im having troubles coding points multiplier system,Im new to coding
I want to make a system where upon collecting a carrot a value is added to the "bucket",and when the bucket gets to a certain value the Multiplier changes
Im mainly having problems with scopes of values of variables
Here's the code I have right now
var Carrots : int = 0
@onready var label = $Control/Label
var CarrotMultiplier : int = 1
var CarrotMultiplyerBucket : int = 0
func _ready():
SignalManager.Collected_Small.connect(smallcollected)
func _process(_delta):
pass
func smallcollected():
Carrots += 1 * CarrotMultiplier
CarrotMultiplyerBucket += 1
label.text = str(Carrots)
There must be a part of GDscript Im missing