Loading models and NullPointer

Hi. So far I was very happy with JME3 and then i got this problem:



I am loading some spatial object:



Spatial wall_inside_obj = assetManager.loadModel(“Models/wall.obj”);



Display is fine but when I want to add it to bullet:



RigidBodyControl wall_rigidb;



com.jme3.bullet.collision.shapes.CollisionShape wallShape =

CollisionShapeFactory.createMeshShape((Node) wall_inside_obj );

wall_rigidb = new RigidBodyControl(wallShape, 0);

wall_inside_obj.addControl(wall_rigidb);

*null pointer → bulletAppState.getPhysicsSpace().add((wall_rigidb);



I got a NullPointerException.

maybe bulletAppState is null?

Yes, it is it.



Thanks!