Hi ! I'm trying to make an enemy spawner.
The enemy is supposed to chase the player if it enters a zone. If i place the enemy directly in my level scene, it works well. But when the enemy if from the spawner, it dosent see the player...
here is the script for my enemy chasing the player:
func physicsprocess(delta: float) -> void:
if player != null:
move = position.directionto(player.position) * speed
func onPlayerckeckbodyentered(body: Node) -> void:
if body != self:
player = body
here is my script for the spawn:
var enemy_preload = load("res://actors/enemy.tscn")
func _ready() -> void:
var enemy = enemypreload.instance()
My spawn is composed of two nodes, one parent node that is "spawner" and a child node that is 'container'.
thanks a lot !