title: Gogot Engine error issue: "body set shape disabled" and "body set shape as one-way collision"
body: <p>I have a problem with the engine Godot, with the errors &quot;body set shape disabled&quot; and &quot;body set shape as one-way collision&quot;.</p>
  <p>In my project I have built four scenes:</p>
  <ul>
  <li><p>The <code>platform</code> scene formed by (<code>StaticBody2D</code> which has as child objects(<code>CollisionShape2D</code>, <code>Sprite</code>, <code>Position2D</code>, <code>Area2D</code> which in turn has a child object(<code>Collisionshape2D</code>))</p>
  </li>
  <li><p>The <code>missile</code> scene formed by (<code>RigidBody2D</code> which has as child objects(<code>CollisionShape2D</code> and <code>Sprite</code>));</p>
  </li>
  <li><p>The <code>spaceship</code> scene formed by (<code>Kinematicbody2D</code> which has as child objects(<code>Sprite</code> and <code>CollisionShape2D</code>));</p>
  </li>
  <li><p>The <code>main</code> scene which has as root node <code>Node</code> and as child objects: (platform and spaceship).</p>
  </li>
  </ul>
  <p>Moreover I have two scripts: one in the <code>spaceship</code> scene, on the <code>Kinematicbody2D</code> node; and then in the <code>platform</code> scene on the <code>StaticBody2D</code> node.</p>
  <p>Basically when I start the game there is the <code>platform</code> at the top center and then there is the <code>Area2D</code> (with the <code>CollisionShape2D</code> to detect when a body enters the area and then there is also the <code>Position2D</code> that I set for a position where it should instantiate the missile at runtime).</p>
  <p>When a body enters the <code>Area2D</code> the <code>platform</code> should instantiate a <code>missile</code> (which does nothing for the moment).</p>
  <p>The problem arises when I direct the <code>spaceship</code> in the <code>Area2D</code> and the <code>platform</code> instantiates many times (more than 200-300 times per second) the missile and this is the moment when the game crashes. I get the errors that I wrote above and then I have to close it.</p>
  <p><strong>Spaceship Code:</strong></p>
  <pre><code>extends KinematicBody2D
  
  var target
  var click
  var dir
  var collision
  var speed = 200
  
  func _input(event):
      if event is InputEventMouseButton:
          target = get_global_mouse_position()
          click = true
  
  func _physics_process(delta):
      if click:
          dir = position.direction_to(target)
          collision = move_and_collide(dir * speed * delta)
          if collision:
              pass
  </code></pre>
  <p><strong>Platform Code:</strong></p>
  <pre><code>extends StaticBody2D
  
  var trigger
  var missileScene = preload(&quot;res://scenes/Missile.tscn&quot;)
  var missile
  
  func _on_DangerArea_body_entered(body):
      if body is KinematicBody2D:
          trigger = true
      while(trigger):
          missile = missileScene.instance()
          $SpawnPosition.add_child(missile)
          yield(get_tree().create_timer(3),&quot;timeout&quot;)
  
  func _on_DangerArea_body_exited(body):
      if body is KinematicBody2D:
          trigger = false
  </code></pre>