What does 'recover_from_penetration' error mean?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Macryc

Hi All. I have a kinematic body moving along a path towards a target point. Each time the body touches a mesh instance (which does not have a collision shape) the Debugger is printing the following error on every frame:

E 0:00:33.961   recover_from_penetration: Condition "shape_idx < 0 || shape_idx >= cs->getNumChildShapes()" is true. Returned: false
  <C++ Source>  modules/bullet/space_bullet.cpp:1241 @ recover_from_penetration()
  <Stack Trace> kinematicBody.gd:106 @ _physics_process()

What is this error and how can I get rid of it. When the body moves across a field of tall grass clumps (which are textured meshes and I don’t want then to collide with anything, naturally) I see hundreds of lines of this error in the Debugger…

i also noticed that if i add a collision shape to the grass clump object and set it to ‘Disabled’, the problem disappears…

Macryc | 2020-04-10 08:07

Yeah, I’ve been seeing this for a while. I haven’t found anything yet, hopefully someone knows

andersmmg | 2020-04-10 13:47

The related issue #31144 about move_and_collide() returning shapes that should not be used, could give some hints maybe

flurick | 2020-04-10 14:43

I fixed the issue I’ve been having finally. There isn’t really anything online explaining what recover_from_penetration does, but I think I understand it. It’s meant for keeping objects from being inside each other. If you have an object that is being pulled into another in any way, this error will show up. Is there something controlling any of the physics objects in a way that the physics system wouldn’t be able to do it’s job?

andersmmg | 2020-04-11 00:20