Hi, i'm new to Godot
This is my first Godot project. Its for my school project
I working on a farming game
What i want to do here is disabling a button if the coin variable is less than 25. The concept of that looks like this: You don't have enough money = you can't buy the item
Here is the code:
extends Node
func _process(delta):
If Global.coin < 25:
$parent/BuyButton.disabled = true
But, when i run the game, and click a button that decrease coin variable until the coin value is below 25, its shows an error message: Invalid set index 'disabled' (on base: 'null instance') with value of type 'bool'.
How do i fix that?
P.S: Sorry if my question looks un-specific(or have bad grammar)