Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Simon |
Hi,
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:
func _on_Area2D_area_entered(area):
$AnimationPlayer.play("wait")
$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?