When I spawn object "Enemy" from a timer script in the main scene, the ennemy can't acces the player node and return null. But Its work proprely when an ennemy is added direcly to the scene.
Here the main node with all the child items.

Timer script =>
extends Timer
var enemy1 = preload("res://Enemy.tscn")
var x = -107
var y = -107
var cnt
func _ready():
pass
func _on_Timer_timeout():
print("spawn")
x+=10
y+=10
var Player = get_parent().get_node("Player")
if(Player != null):
var enemy1_instance = enemy1.instance()
enemy1_instance.position = Vector2(x,y)
add_child(enemy1_instance)
wait_time = 2;
Enemy Script=>
extends KinematicBody2D
var motion = Vector2()
var player = null
func _ready():
pass
func _physics_process(delta):
var player = get_parent().get_node("Player")
if player !=null:
position += (player.position - position)/50
look_at(player.position)
move_and_collide(motion)
else:
print("playerNull")
func _on_Area2D_body_entered(body):
if "Bullet" in body.name:
queue_free()
In the func _physics_process(delta) if the enemy is dynamicaly generated from the timer script var player = get_parent().get_node("Player") return null...
Thank you for helping me