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 “GameManager.gd”

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

Second function is belong to “Player.gd”

func hurt():
	motion.y -= 1
	yield(get_tree(),"idle_frame")
	motion.y -= JUMP_SPPED 
	$AudioStreamPlayer.stream = load("res://SFX/pain.ogg")
	$AudioStreamPlayer.play()

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

func _ready():
	add_to_group("GameStatus")

and call this group with method “hurt” :

get_tree().call_group("GameStatus","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.