I tend to make variables private when a bunch of other functionality needs to happen whenever the value is changed.
By forcing functionality to run through a setter, I make sure that I can’t accidentally change a variable’s value and forget to update any systems that may be reliant on that value.
A common case for me is when I have two things that I want to keep references to each other.
For Example: By forcing the scripter to change a player’s team value through a setter, I can make sure I don’t accidentally ever try to change the player’s team reference without also informing the team that their members have changed.
I find this doubly helpful when working on projects in a group. It makes sure another scripter doesn’t need to know about all the systems that rely on a variable before that scripter can make use of the variable.