Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you do not load default settings the flyCam will be equal null #2159

Open
AlexandrPutenikhin opened this issue Dec 10, 2023 · 2 comments
Open

Comments

@AlexandrPutenikhin
Copy link

public static void main(String[] args) {
        Battletown app = new Battletown();
        
        AppSettings settings = new AppSettings(false);
        settings.setFullscreen(true);
        
        app.setSettings(settings);
        
        app.setShowSettings(false); //Settings dialog not supported on mac
        app.start();
    }
flyCam.setEnabled(false);
SEVERE: Uncaught exception thrown in Thread[jME3 Headless Main,5,main]
java.lang.NullPointerException: Cannot invoke "com.jme3.input.FlyByCamera.setEnabled(boolean)" because "this.flyCam" is null
	at com.waystudio.Battletown.simpleInitApp(Battletown.java:31)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240)
	at com.jme3.system.NullContext.initInThread(NullContext.java:102)
	at com.jme3.system.NullContext.run(NullContext.java:146)
	at java.base/java.lang.Thread.run(Thread.java:833)
@pspeed42
Copy link
Contributor

I think you will find that it isn't the only thing wrong... just the first bad thing to happen.

A clue:
"com.jme3.system.NullContext"

Another clue:
"Thread[jME3 Headless Main"

...JME thinks it's running in headless mode because you haven't setup the renderer and the other things that need to be manually set when you tell the settings not to use the defaults.

Is there a reason you are telling it not to use defaults?

@stephengold
Copy link
Member

@AlexandrPutenikhin if you don't wish to continue the conversation, please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants