Hey!
I'm a new GDscript programmer, and I have a question about best practices when it comes to exposing values for the animation editor to use.
I have a variable in my player that tracks when an animation ends. To actually set this variable in the animation editor, there are two possible methods I've come across.
1. Using a Property Track
This requires I export the variable, which logically, should be private.
class_name Player
extends CharacterBody2D
@export var animation_over := false
2. Using a Call Method Track
This requires I write a new method with the sole purpose of switching the animation off, but doesn't expose the variable.
class_name Player
extends CharacterBody2D
var animation_over := false
func end_animation():
animation_over = true
I've seen both methods used in my research. Is there a method that's more godot-like? I looked in the documentation, and it seems like there are pros and cons to both.