+3 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.

in Engine by (1,547 points)
edited by

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.