Camera spins when Joystick is plugged in

I’m using the default camera(s), the flybycamera and the normal camera.

And are you able to write Java code? For example a class OwnCamera extends FlyByCamera?

I can but I’m trying to use the default camera.

No problem, it’s just to find the problem. We didn’t find it yet.

You could make that OwnCamera and override the method mapJoystick, just make an empty method with nothing in it. Then start to add code from: [jmonkeyengine/FlyByCamera.java at master · jMonkeyEngine/jmonkeyengine · GitHub].

I guess it’s the

joystick.getAxis( JoystickAxis.Z_AXIS )

Where that input comes from.

It’s strange though.

Sorry, I don’t have an XBox One gamepad here and am currently asking some people if they can lend me one. Until then we can only try to find where this input comes from.

It should be possible to debug the code, set breakpoints, look deeper into the monkey engine, etc.
But for that you need some specific skills.
Maybe get those skills first, and until then use jME with keyboard and mouse.

EDIT: Maybe someone else has an idea for you. I’m currently short on time also…

Try this:
Add a file called joystick-mapping.properties to the root folder of your assets. Then head over to the built in file (jmonkeyengine/joystick-mapping.properties at master · jMonkeyEngine/jmonkeyengine · GitHub) and copy paste the part for xbone s pad into your file. Then change the name of the mappings from “Microsoft\ X-Box\ One\ S\ pad” to whatever test joystick outputs the name of your gamepad to be.
That fixed it for me with xbone s pad and I did eventually make a PR so it’s now in the core.

1 Like