Getting "init()": Condition "err" is true. Returning: err" error

Godot Version

Godot 4.1.1


When initiating a state machine my player gives it a “parent” (a CharacterBody2D) that is the players “self” value. I get the error on the line where I set my state machine’s children’s “parent” value as that player. This error continues to play forever.

My code in my state machine:

func init(
		parent: CharacterBody2D, 
		animations: AnimationPlayer, 
		is_p1: bool, 
		player_dead_con: String,
		) -> void:
	for child in get_children():
		child.parent = parent
		child.animations = animations
		child.move_component = move_component
		child.is_p1 = is_p1
		child.player_dead_con = player_dead_con

My code in my players ready function:

state_machine.init(self, movement_animations, player_move_component, is_p1, player_dead_con)

Please show your code, you’re not providing any information on what’s wrong

Better now?

Does it work if you remove the last comma, so player_dead_con: String not player_dead_con: String,?