The identifier Player isn't declared?

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

Just started using Godot after using unity and most of my projects never getting close to completion disided to switch to Godot and have started going off a tutorial on a 3d maze game and got stuck on one piece of code and don’t really understand the problem extends Spatial

signal level_completed()

func _on_Goal_body_entered(body):
if body is Player:

	emit_signal("level_completed")
:bust_in_silhouette: Reply From: Help me please

I think you should use this:-

signal level_completed()

func _on_Goal_body_entered(body):
if body.name ==  "Player":
    emit_signal("level_completed")