After adding a control, the other returns a null exception?

Hi guys!

Today i decided to add a PhysicsControl (with the SceneExplorer) to my terrain, to make a walking character. When i added that control, the TerrainLodControl starts to throw NullPointerExceptions:


I already tested the getChild() method and it works. When i try to get the lod control, it crashes.

The exception:

Set 20, 2014 7:51:19 PM handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
at mygame.Main.simpleInitApp(
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(

Can somebody explain me what i did wrong?

That’s your code throwing the NPE… not the terrain control.

I will assume that it’s the line you posted that is the one in your Main.simpleInit() where the exception is happening.

2 seconds in a debugger would tell you exactly what the issue is but it’s either that getChild() is returning null or that getControl() is returning null. An assumption somewhere on your part is faulty.

I really don’t know what happened, but i discovered the error: the terrain_Terreno changed to terreno-Terreno! OMG i feel so stupid now… but i don’t know why it changed the name. Anyways, thanks!