this works:
func _on_HeadstrongRush_pressed():
if headstrong_rush_ps < 5:
if headstrong_rush_ps > 0:
has_headstrong_rush_skill = true
headstrong_rush_ps += 1
skill_points -= 1
$AllUIHere/Skills/WardenSkills/Set1/HeadstrongRush/SkillLevel.text = str(headstrong_rush_ps)
so why doesn't this work :
func _on_PomelStrike_pressed():
if pomel_strike_ps < 5:
if pomel_strike_ps > 0:
has_pomel_strike_skilll = true
pomel_strike_ps += 1
skill_points -= 1
$AllUIHere/Skills/WardenSkills/Set1/PomelStrike/SkillLevel.text = str(pomel_strike_ps)
The error is that I can't compare pomel_strike_ps
using <
but both variables pomel_strike_ps
and headstrong_rush_ps
are two integers, side by side.... Chat GTP says that the problem is that the variable is probably not initialized in time, tried to put onready var
and nothing changed, tried waiting and nothing changes.
int
type explicitly, so Godot will throw an error if they are being used as something other than an integer somewhere else. \$\endgroup\$