I have a projectile that is a
KinematicBody2D, which I move by calling
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
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.