The general convention is to use "$" to assign a variable with the path to be used throughout your code, rather than having to call get_node()
various times for the same thing. This leads to cleaner code that is much more readable.
Using "$" such as
onready var player = $Player
will run when the script has been checked through and will remain usable for the time the script is active in your game. However, by calling get_node()
, this acquisition of the node will have to run each time the corresponding function it lies within is called, ie., more than once at the beginning of execution.