call_group()-What happend if many nodes in a group have the same function name but different content?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By EraTi

I have two hurt() function
First function is belong to “”

func hurt():
	lives -= 1
	if lives == 0:

Second function is belong to “”

func hurt():
	motion.y -= 1
	motion.y -= JUMP_SPPED 
	$ = load("res://SFX/pain.ogg")

If I joined both “GameManager” and “Player” node to a group by adding the below code in both script:

func _ready():

and call this group with method “hurt” :


What happend if two nodes(GameManager and Player) in a group(GameStatus) have the same function name(hurt) but different content(One count the life of player, one give the player reaction)?

I tried in my script and look like they call the both function"hurt"?

I am beginner so sorry if this question is too basic.

:bust_in_silhouette: Reply From: EraTi

OK, I figured out by myself.
The functions are called in turn following its order in the tree.
Also, the call_group() also detect the number of parameter and call the function meet requirement.
Thank you so much.