0 votes

Hey, im having a problem with the getnode(...).settext(...) combo. In every aspect it is working fine, but for some reason in one part of my menu it is misbehaving.
On my player stats display i have some sub stats based on the main stats, like attack based in the player strenght, when i change the player Main Stats the sub stat make the calculations and recalibrate by it self and this is working fine (i constantly check in the output printing every stat and substat) but my in game "character sheet" lable node, way of checking just dont get the right number, For exemple: My hit points is showing the right numbers in both in game sheet lable node and output tab, but the attack just show a random number (shoulf be 124 and is showing 9) that dont even make sense, and it is the right number in the output tab, the dodge statistic just miss by 1 (40 to 41).

This is the way that im geting the numbers to show in the "character sheet lable node":

get_node(path_statistics + "ASPD/Value").set_text(str(player.attack_speed))
get_node(path_statistics + "Critical/Value").set_text(str(player.critical))

where "player" is a var to my "onready var player = get_node("../../player").

Anyone have any ideia how to solve my problem ? this has been disturbing me for days now. Ty.

Edit: as asked by GameSpy, this is the print () function:

if Input.is_action_just_pressed("Slot 4"):
    print("Level:",level)
    print("ASPD:",attack_speed)
    print("CRIT:",critical)

and this are the variables:

var level
export(float) var attack_speed
export(float) var critical

this funcion is already in my player script in my player node as are those variables

in Engine by (22 points)
edited by

Not enough information.Show us the print() function as well. Make sure that both the print and set_text use the same player node.

More information added to the question

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.