| Attention | Topic was automatically imported from the old Question2Answer platform. | |
| Asked By | Merlin1846 |
I would like to be able to print a class like an array, what I mean by this is that when you print an array you get this.
var array: Array = [1,2,3,4,5]
print(array)
# Output
[1,2,3,4,5]
I want to be able to do this with a class but I wanted to know if there was a way to do this without going through each value using get_property_list(). Like this.
class Test:
var valueA = 1
var valueB = 1
print(Test)
# Output
{"valueA": 1, "valueB": 1}
Kinda like if you printed a dictionary.
Don’t strain yourself when you want to look at the contents of a class/object. Instead, put in breakpoints where you want to see the values. When you run the code, it will stop at the breakpoint. Then you can go into the debugger panel, and see the current, in-scope values of the variables.
Ertain | 2022-09-11 08:48