extends Spatial var is_ready = true var Food = 10 func _ready(): # Get the area for the trigger, and assign it's body_entered signal to trigger_body_entered $Holder/Food_Pickup_Trigger.connect("body_entered", self, "trigger_body_entered") # Now we can use all of our setget functions. is_ready = true func _physics_process(delta): $AnimationFood.playback_speed = 4 func trigger_body_entered(body): if Globals.lifeforce != 100: Globals.lifeforce += Food if Globals.lifeforce >= 100: Globals.lifeforce = 100 Globals.food_task = true