Hello! I'm working through a tutorial series for making a Tetris clone, but I've run into an issue translating Godot 3.5's setget system to Godot 4 (which is what I'm using).

I attempted to translate the setgets from the tutorial into Godot 4's version, but the set_high_score function (lines 45-47) crashes the debugger on launch due to creating an infinite loop. The problem is that I don't have a great grasp of how I need to rewrite the variable (lines 22-26) so that the function will run correctly.

Any help would be greatly appreciated!

Here's the code involved:
![
](https://)

  • Toxe replied to this.

    RentAThug You need to define your property like this if you want to declare an explicit setter function:

    var high_score = 0:
        set = set_high_score

    Also if your getter just returns the property value then you can just omit it.

      Toxe Thank you! I wasn't sure which elements from the function needed defining in the variable and which ones were just part of the function. I just updated the variables and ran a test, and it doesn't crash anymore, so I'll be able to keep going on the tutorial!

      • Toxe replied to this.