That is indeed incorrect. This is probably more in line with what you want to do:
func _ready():
set_monitoring(true) # This is needed for the body_entered signal to even work.
func _on_DetectPlayer_body_entered(body):
if body.name("Player"): # This might need to be the name of the player's CollisionShape node instead!
set_physics_process(true) # Also note that the processing will likely kick in on the next physics frame and not immediately.
else:
set_physics_process(false)
func _physics_process(delta):
var Player = get_parent().get_node("Player")
position += (Player.position - position)/50
look_at(Player.position)
move_and_slide(motion)
You'll likely have to also connect the body_exited() signal and in it set physics processing to false in certain conditions. Also, for the monitoring to work, I wonder if you'll have to use _process() instead of _physics_process() for the logic and let the _physics_process() be enabled continuously(but empty of any scripted logic for this node) perhaps. Guess you'll have to experiment and find out, very exciting!