call other object's script function from other function

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

am using GDScript and i have other object with function called Change_Location, and am trying to call this function from other script
the code:

$CameraBody/Camera/BuyHouses/StaticBody.Change_Location(mx, my)

the object CameraBody is not recognized but its exists in the world node
can someone help me?

the whole function:

func on_input_event(camera, event, click_position, click_normal, shape_idx):
	var mouse_click = event as InputEventMouseButton
	if mouse_click and mouse_click.button_index == 1 and mouse_click.pressed:
		var mouse_pos = get_viewport().get_mouse_position()
		var mx = mouse_pos.x
		var my = mouse_pos.y
		$CameraBody/Camera/BuyHouses/StaticBody.Change_Location(mx, my)
:bust_in_silhouette: Reply From: R3tr0

i fixed it, i had to navigate to the location of the node

$"../../CameraBody/Camera/BuyHouses/MenuLoc".Change_Location(mx, my)