Help with Animation [Closed solution found]

Solution found



my code was working fine till yesterday but for sme reason getting error now… sme 1 help me and tell me if i am doing anything wrong::

E: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.NullPointerException

at mygame.Main.initiateMobs(Main.java:348)

at mygame.Main.initializeGame(Main.java:177)

at mygame.Main.simpleUpdate(Main.java:239)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:241)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:158)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:203)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:221)

I am a nub programmer Only in grade 11 X_X dunt make fun of me

cheatcat said:
Check if all arrays have been initialized. So before you run the code you should initialize all containers you use in the code, like mobnumbercontroller, mobholder, control, shootables, channel. If you wanna have a fail-proof function you either have to check if all containers isn't null or use try-catch.



Thanks for ur help @cheatcat but I already found a solution
cheers**

Check if all arrays have been initialized. So before you run the code you should initialize all containers you use in the code, like mobnumbercontroller, mobholder, control, shootables, channel. If you wanna have a fail-proof function you either have to check if all containers isn’t null or use try-catch.

When the error happens in your own code posting a stack trace here will not help much as nobody knows what you do in your code. Also, nullpointers are the easiest exceptions to track… Its simple, one of the variables in that line is null… Check which one and then look why its not initialized…

Also, just posting “it works now” is just as bad. Other people that have similar problems might find this thread and then they don’t see what the solution was. Please put more thought into it before posting here…