Advertisement
Guest User

Untitled

a guest
Jan 14th, 2024
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var forgive_group
  2.  
  3. func _ready():
  4.     forgive_group = "forgive_" + str(get_instance_id())
  5.     ForgiveArea.body_entered.connect(_earlyProcessItem)
  6.     #...
  7. #...
  8.    
  9. func _earlyProcessItem(body:Node2D):
  10.     if not body.is_in_group(forgive_group):
  11.         body.add_to_group(forgive_group)
  12.  
  13. func _processItem(body:Node2D):
  14.     var Item = body as ItemClass
  15.     #Check how item compares to the mode the machine is on
  16.     if self.ItemIsCorrectType(Item):
  17.         #...
  18.     elif body.is_in_group(forgive_group):
  19.         pass #
  20.     else:
  21.         #...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement