Using GDScript in Godot 4, I'd like to customize the string representation of a class using the default representation plus my own message. So, I'm just doing:
func _to_string():
var my_string = super.to_string()
my_string += " -> GREEN" if is_green else " -> RED"
return my_string
However, this results in a stack overflow because of infinite recursion. Also tried using (self as Object).to_string()
with the same result. Is there a way to do this?