_call_function: Error calling deferred method: 'Viewport::add child': Method not found..

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

I am not sure what is causing this error. I am following a tutorial and I have rewritten this code so much and I still get the error.

bullet_instance.position = get_global_position()
bullet_instance.rotation_degrees = rotation_degrees
bullet_instance.apply_impulse(Vector2(), Vector2(bullet_speed,0).rotated(rotation))
get_tree().get_root().call_deferred("add child",bullet_instance)

the error:
_call_function: Error calling deferred method: ‘Viewport::add child’: Method not found…

:bust_in_silhouette: Reply From: timothybrentwood

get_tree().get_root().call_deferred("add child",bullet_instance)
should be:
get_tree().get_root().call_deferred("add_child",bullet_instance)