Hi all, I want a little debug window that will show stats like HP, velocities and other variables during playtesting. This is to avoid having to add print statements strewn throughout the code. I managed to get this working with the global variables found in the games' main script, but I can't figure out how to display localised stats. I have also tried to @export these variables on the character, to no avail.
Working example for the character's HP (global variable in the Game.gd script):
extends Label
func _process(_delta):
text = "HP: " + str(Game.characterHP)
Non functioning example for the character's X velocity:
extends Label
func _process(_delta):
text = "Vel X: " + str(get_node("../../Character/new_character").velocity.x)
The error I receive is....
Invalid get index 'velocity' (on base: 'null instance')
Any help as always, appreciated!