I tried this:
extends Panel
func _on_SetButton_pressed() -> void:
get_node("../../Fish")._set_pos(Vector2(0,0))
The function setpos on Fish.gd:
func _set_pos(pos):
mode = MODE_KINEMATIC
position = pos
mode = MODE_RIGID
print("Done")
It doesn't work, it only prints "Done", it works only if I set the default mode of the Rigid Body2d to be kinematic (but then he can't move until the func setpos is called) or calling $Fish.position = Vector2(0,0) in the node "Main".