createSingleBoxShape NullPointerException

Hey guys,

I’m getting this error:

[java]Exception in thread “Thread-5” java.lang.NullPointerException

at com.jme3.bullet.util.CollisionShapeFactory.createSingleBoxShape(

at com.jme3.bullet.util.CollisionShapeFactory.createCompoundShape(

at com.jme3.bullet.util.CollisionShapeFactory.createCompoundShape(

at com.jme3.bullet.util.CollisionShapeFactory.createBoxCompoundShape(

at com.jme3.bullet.util.CollisionShapeFactory.createBoxShape(

at Game.Physics.BasicPhysics.CreateShape(



… from this call:

[java] public void CreateShape() {

// check if makeFrom is valid

if( makeFrom != null && makeFrom instanceof Node ) {

Node mf = (Node)makeFrom;

List<Spatial> Children = mf.getChildren();

for(int i=0;i<Children.size();i++) {

if( Children.get(i) == null ) {

// null child found!





switch( shapeType ) {


if( makeFrom != null ) {

myShape = CollisionShapeFactory.createBoxShape(makeFrom);



I’m trying to see where the NullPointerException is coming from by checking makeFrom before making the call to createBoxShape… but even with all those null checks, I still get the exception occasionally. I don’t think it is a threading problem, since I only set makeFrom during the construction of this object, but I’m not really sure what is going on :frowning: Any suggestions?