New to programming and I'm having some trouble with incrementing a value up from within a function. I'm using the following code:
extends Node2D
var coins = 0
func testfunction(a):
a += 1
print(a)
func _on_Timer_timeout():
testfunction(coins)
All this does is print the number 1 over and over again every time the Timer times out (every 0.5 seconds), when I want it print 1, 2, 3 and so on. What am I doing wrong here?