Cant get the shipforwardaction to work (furballz)

rotateleft and right works, but not forward and back. I keep getting this errpr:


java.lang.NullPointerException
   at spacearena.controls.ShipForwardAction.performAction(ShipForwardAction.java:25)
   at com.jme.input.ActionTrigger.performAction(ActionTrigger.java:264)
   at com.jme.input.ActionTrigger$CommandTrigger.performAction(ActionTrigger.java:291)
   at com.jme.input.InputHandler.processTriggers(InputHandler.java:414)
   at com.jme.input.InputHandler.update(InputHandler.java:399)
   at spacearena.Arena.update(Arena.java:46)
   at com.jme.app.BaseGame.start(BaseGame.java:66)
   at spacearena.Arena.main(Arena.java:39)



i think this is the code thats causing it, but not sure


velocity.addLocal(temp.multLocal((ship.getEngineStrength()*time)));



thanks for ne help.

That would suggest either ship, temp or velocity is null.  Try scanning the code visually to see if maybe you are missing setting something or initializing the temp variable, etc.  Or try printing those 3 vars out prior to that line to narrow the issue down.

I printed out the 3 things u listed and it turns out currentvelocity wasnt initiated :(, got it working. THanks.