i try to make a platformer with some desappearing platform that when my player enter the platform area play an animation, sprite become invisible and collision become disabled. This is my code:
$Sprite.visible = false
$CollisionShape2D.disabled = true
But when my player jump on the platform the collision it's not disabled and this error message arrives:
body_set_shape_disabled: Can't change this state while flushing queries. Use call_deferred() or set_deferred() to change monitoring state instead.
How can i do this?