While loop stop main loop

i make loop, but it stop main loop. Help plz

extends Area2D


@onready var sprite = $Sprite
@onready var audio = $Audio
@onready var body = $Body
var rock = false


func disable_stone(player, stone_thread):
    stone_thread.start(await disable(player, stone_thread))

func disable(player, stone_thread):
    if !rock:
        print("super")
        rock = true
        await get_tree().create_timer(0.5).timeout
        body.colbox.disabled = true
        sprite.modulate.a8 = 100
        audio.play()
        await get_tree().create_timer(2).timeout
        while !(player in get_overlapping_areas()): pass
        body.colbox.disabled = false
        sprite.modulate.a8 = 255
        rock = false
    stone_thread.wait_to_finish()

I spawn thread. I dont know how fix that. I trying all thats i know.



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation