+2 votes

I have a projectile that is a KinematicBody2D, which I move by calling move_and_collide() in physics_process().

The projectile seems to randomly throw the following error:

Condition '!body->get_space()' is true. returned: false error

The stack trace points me to this line in my code, which is in physics_process():

var collision = move_and_collide(vel * delta)

The error doesn't cause the game to crash, but I would still like to fix it.

I don't see the error every time I spawn a projectile, only sometimes.

Even if I remove the projectile from all collision layers and disable all its collision masks, I still see this error.

The only other physics objects in my scene are my Player (which is also a KinematicBody2D) and a TileMap (which has collision).

What could be causing this error?

I am working in Godot 3.0.6.

asked Dec 10, 2018 in Engine by Diet Estus (1,480 points)
edited Dec 10, 2018 by Diet Estus

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.