Objects do not appear in the game

Hi, I was trying to get Nifty to work after I made a small world. Nifty now works great, but I’ve been unable to show my objects on the gamescreen.
I’ve added a few blocks on various positions and checked if they were being attached to the node or not. They were being attached as I looked at the console and found: INFO: Child (box) attached to this node (Root Node)
They however did not appear on the screen.
I’ve also tried adding some guiding lights like a sun, but these also didn’t appear on the screen.
The camera however is being attached to my ‘player’-model as seen in the console: INFO: Child (Camera) attached to this node (data/models/Box.blend).
When loading the xml file for Nifty and going to the ‘Game’, that works, as there is a button added in the xml and that button does appear on the screen.

After eliminating all these possible problems, I have no clue where to look next, I hope you can help me :slight_smile:

Here’s the code:

[java]public class Main
private static MainApplication game;

public static void main(String[] args)
	game = new MainApplication();

public static MainApplication getGame() 
	return game;


[java]public class MainApplication extends SimpleApplication
public MainApplication()

public void simpleInitApp()
	NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
	Nifty nifty = niftyDisplay.getNifty();
	nifty.fromXml("data/gui/screens.xml", "game");

//simpleUpdate left out


[java]public class GameController extends AbstractAppState implements ScreenController
private Player player;
private World world;
private InputManager inputmanager = new InputManager(this);

public Player getPlayer()
	return player;

public void bind(Nifty arg0, Screen arg1) {}

public void onEndScreen() {}

public void onStartScreen() 
	// Load materials
    // Initialize world
    player = new Player();
		world = new World(player);
    catch (Exception e)

    Box box = new Box(10, 10, 10);
	Geometry geo = new Geometry("box", box);
    // Add to the rootNode, the nodes of the scene and hud

//button mapping left out

Might you have a solid background on the nifty screen that is covering the scene?

1 Like

Yes, that’s possible, this is what I get:

If that is the case, what can I do to solve it?

I don’t see any lights being added?

Yeah, I left it out of the code, this is what I used:

This is a part of the class GameController in the onStartScreen() method
[java]AmbientLight al = new AmbientLight();

    PointLight sun = new PointLight();
    sun.setPosition(new Vector3f(50, 120, 50));

My game part of the Nifty is:

If this is causing the problem, is it possible to make the background transparant?

your layer background is a solid black. Remove the backgroundColor or set its alpha value (the last hex value)


Thank you for the help and the fast responses! It seems that this was indeed the problem. I can now see everything I put on it :slight_smile: