![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | quadra123 |
var items_in_range = {}
var inarea= false
func _ready():
pass
func _on_Area2D_body_entered(body):
items_in_range[body]= body
print("entered")
inarea=true
func _input(event):
if event.is_action_pressed("TALKTONPC"):
if inarea == true:
if body.is_in_group("NPCHH"): #ERROR OCCURS HERE!!!
var new_dialog = Dialogic.start("fionasays")
add_child(new_dialog)
func _on_Area2D_body_exited(body):
if items_in_range.has(body):
items_in_range.erase(body)
print("exited")
The identifier ‘body’ isnt declared in the current scope. How can i check if the body enter the area is in group “NPCHH”?