Why does my run not reload when my sprite hits the enemy(beginner)

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

My scene won’t reload when my sprite hits the enemy, chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://godottutorials.pro/wp-content/uploads/2020/07/Godot-Game-Development-for-Beginners.pdf (im on page 34 for this tutorial).
E 0:00:01.080 emit_signal: Error calling method from signal ‘body_entered’: ‘Area2D(enemy.gd)::_on_Area2D_body_entered’: Method not found…
<C++ Source> core/object.cpp:1242 @ emit_signal()
W 0:00:00.604 The argument ‘delta’ is never used in the function ‘_process’. If this is intended, prefix it with an underscore: ‘_delta’

Camera2D.gd:12 W 0:00:00.597 The function 'reload_current_scene()' returns a value, but this value is never used. RETURN_VALUE_DISCARDED enemy.gd:62

Declare member variables here. Examples:

var a = 2

var b = “text”


export var speed : int = 100
export var moveDist : int = 100

onready var startY : float = position.y
onready var targetY : float = position.y + moveDist

Called when the node enters the scene tree for the first time.

func _physics_process (delta):
pass # Replace with function body.

move to “targetX” position

position.y = move_to(position.y, targetY, speed * delta)

#if we’re at our target, move in the other direction
if position.y == targetY:
if targetY == startY:
targetY = position.y + moveDist
targetY = startY

move “current” towards “to” in an increment of “step”

func move_to (current, to, step):

var new = current

# are we moving positive?
if new < to:
    new += step

    if new > to:
        new = to
# are we moving negetive?
    new -= step

    if new < to:
        new = to

return new

Called every frame. ‘delta’ is the elapsed time since the previous frame.

#func _process(delta):


#new function player colliding with enemy

called when we collide with a physics body

func _on_enemy_body_entered(body):

if body.name == "player":

func die():

:bust_in_silhouette: Reply From: exuin

The error says the function is called on_Area2D_body_entered but the code you provided says on_enemy_body_entered.