Can you call on a class and have to continue to show a changed variable (I am not good at explaining things so bear with me, I am not in tune with all the technical words either which makes it worse but here goes nothing)
for example:
-button.gd-
class_name SC
var Stone = 0
func _on_pressed():
Stone += 1
I want it to update the stone variable so it prints the updated number and not 0 which is the default number I have not found anything that clearly explains sharing variables between scripts (I am trying things with classes so I have the basics of classes down) all I have found are to use the global way or some other way but nothing explains it well enough to understand or use for me if someone can explain how to do that it would also solve my problem.
I’m confused about why you named your function like this. If you are extending SC, you can just call it func _on_pressed(). Did you leave out a space?
If I understand correctly, you want to inherit SC and when _on_pressed() is called, it will increase the stone variable by 1 and then print the value of stone. Each instance of the class that inherits SC should use the same stone variable, as a shared property across all instances. Did I get that right?