Problem with Chase Camera


I've got a problem with the Chase Camera. My code is based on a modified version of the FlagRush tutorial.

It gives a null-pointer exception, but I can't find where it goes wrong. Where/how must I search where the error is. This is the code:

    protected void update(float interpolation) {

        // update the time to get the framerate


        interpolation = timer.getTimePerFrame();

        //update the keyboard input (move the player around)


        //update the chase camera to handle the player moving around.



        //we want to keep the skybox around our eyes, so move it with

        //the camera

        // skybox.setLocalTranslation(cam.getLocation());


        // if escape was pressed, we exit

        if (KeyBindingManager.getKeyBindingManager().isValidCommand("exit")) {

            finished = true;



        //Because we are changing the scene (moving the skybox and player) we need to update

        //the graph.

        scene.updateGeometricState(interpolation, true);


This is the error from the log:

21-jun-2006 21:51:55 com.jme.scene.Node attachChild

INFO: Child (null) attached to this node (Scene graph node)


        at com.jme.math.Vector3f.set(Unknown Source)

        at com.jme.input.ChaseCamera.update(Unknown Source)

        at VGS.SnowboardGame.SnowboardGame.update(

        at Source)

        at VGS.SnowboardGame.SnowboardGame.main(

21-jun-2006 21:54:34 start

INFO: Application ending.


BUILD SUCCESSFUL (total time: 2 minutes 52 seconds)

Thanks in advance,


suplying a valid camera and target spatial to the chasecam?