- Edited
Hi! Godot newbie here.
So in my Emeny.tscn
I have this Area2D called PlayerDetection
, when I want to add the signal of body_entered
to a method with the node inspector (or whatever it is called)
a connection is added to the scene file:
[connection signal="body_entered" from="PlayerDetection" to="." method="_on_player_detection_body_entered"]
and a method is added to the script
func _on_player_detection_body_entered(body:Node2D):
I am wondering why the UI is doing this. Doesn't this cause a performance overhead instead of just adding it like so:
func _ready():
$PlayerDetection.connect("body_entered", _on_player_detection_body_entered)
Also the latter is easier to read/maintain imo.
Is this some legacy stuff?
Thanks!