how respawn enemy when player coming

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

extends KinematicBody2D

var motion = Vector2()
var dir = -1

func _ready():
pass
func _process(delta):
motion = move_and_slide(motion,Vector2.UP)
pass

func _physics_process(delta):
motion.x = 50 * dir
$AnimationPlayer.play(“move”)
if is_on_wall():
dir *= -1
$Sprite.flip_h = $Sprite.flip_h
if is_on_floor() == false:
motion.y += 10
pass

func _on_hitbox_body_entered(body):
if body.is_in_group(“player”):
queue_free()
pass

:bust_in_silhouette: Reply From: stormreaver

I don’t think this posting can elicit any answers, as there is no indicator of what specific question you’re asking.