Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | i.want.to.die |
i got a problem that does not seem to affect anything but it is anoying
my enemy is on the celling and shoots acid that on the code i refferd as goo
the ‘goo’ is attechded to a kinematicbody2D that olny moves down
the kinematicbody2D
here is the error message
E 0:00:39.387 area_set_shape_disabled: Can't change this state while flushing
queries. Use call_deferred() or set_deferred() to change monitoring state instead.
<C++ Error> Condition "area->get_space() && flushing_queries" is true.
<C++ Source> servers/physics_2d/physics_2d_server_sw.cpp:409 @
area_set_shape_disabled()
<Stack Trace> goo_spawner.gd:7 @ throw_goo()
upside_inimigo.gd:71 @ _on_Area2D_body_entered()
here is the kinematicbody code
extends KinematicBody2D
var motion = Vector2()
var Floor = Vector2(0,1)
func _process(delta):
motion.y += 7
move_and_slide(motion, Floor)
if get_node("Node2D").destroyed == true:
queue_free()
and here is the ‘goo’ code , it is a area2D
extends Area2D
var damage = 25
var destroyed = false
func _ready():
$Sprite.play('falling')
func _on_Node2D_body_entered(body):
destroyed = true
if body.is_in_group('players'):
body.on_hit(damage)
here is enemy’s ‘goo’ spawner
extends Node2D
var goo = preload("res://goo.tscn")
func throw_goo():
var new_goo = goo.instance()
add_child(new_goo)
i really dont know how to fix it ,it probaly is something really stupid