Problem With Gamepad Sticks Logic Nodes

Hi, I’m new to Armory3D. I am creating a demo which consists of moving a cube. I connected Keyboard and Gamepad (DPad) logic nodes with Translate Object logic nodes and no problem here. The problems start when I link the Logic Nodes Gamepad Sticks (Joystick Left) with the Logic Nodes Translate Object. When I launch the app only the up stick and the left stick works. down stick and right stick not working. Strangely the up stick is mapped to the down stick. Is it an Armory bug where I chose the wrong logic nodes to achieve this result?

Hi. What type of game controller do you have? PlayStation 1-4 controller? Xbox 360 - One controller? Other controller type? I suspect the issue is simply because Armory interprets your game controller type as a different type. iron/Input.hx at main · armory3d/iron · GitHub Type conditions need to be implemented* into the gamepad controller nodes.

I have an Xbox Series controller. However I have a PS4 and Xbox 360 controller. I will try with the Ps4 and Xbox One controller to see if the problem does not come from the Xbox Series controller.

Finally I tried with a PS4 controller then it works. On the other hand, we always have the same problems on an Xbox controller, whether it is an Xbox 360 or Xbox One controller. I don’t know if it’s a bug or you have to add another Logic Node for the Xbox sticks to be recognized?

If you don’t experience this problem in other games using the same controller it could indeed be a bug.

Do you have some Haxe programming knowledge by chance? It would be really helpful if you could test whether the same happens outside of Armory using pure Kha (the framework Armory is based on). If you don’t, I can try to create a small test application for you. This way we can find out whether it happens outside of Armory, and if so, we can report it to the Kha developer so it can be fixed.

I guess you are using Krom for testing? Does the same happen if you use HTML5 instead? What OS are you on?

Edit: I just saw a message from @ RPaladin on Discord about this, perhaps it’s actually Armory-related and the code is currently just using button names for PS controllers…

Edit 2: Could you please test something?

  1. Navigate to <sdk>/iron/Sources/iron/system/Input.hx (where <sdk> is the path to your Armory SDK)
  2. Replace this file with Input.hx (20.8 KB)
  3. In Blender, click on “Clean” in the “Armory Player” panel, and then test again with “Play”

Does it work for you with the Xbox controller then? If you open the console, you should see some debug output giving more information about the controller. What does it say? It would be tremendously helpful if you run the tests with all your controllers and share the debug output for them, although the buttons of PS controllers probably don’t work correctly with my file above.


I replaced the file in the /iron/Sources/iron/system/Input.hx directory. I restarted Blender I clicked on Clean and I launched the game with Armory Player and there is still the same problem. However, I launched the game in HTML5 and the stick responds perfectly. I don’t know if it’s due to a bug in Krom. I’m on Windows 10 22H2.

Here is the debug console when I launched the game.

Yes I would like you to create a small test application for me.

Thanks!

Just to get things right: what controller did you use for the console output above? What happens with the other controllers you have? Are vendor and ID also unknown for the other controllers? If you export to HTML5 and look at the browser’s debug console (not the Blender console), does it also say unknown? If you have Visual Studio installed, you can also test it with the Windows (C) target, the more information we have the better.

Yes I would like you to create a small test application for me.

Since it seems that this is more Armory-related as I initially thought I think we should probably focus on that first (I might create a Kha example tomorrow though).

I’ve changed Input.hx again to also print information of your controller interaction to the console, could you please test again and write which of the up/down/left/right sticks results in which output in the console? If it isn’t too much hassle for you, please test it both on Krom and HTML5 (and perhaps even Windows C) and for each of your controllers (the most important one is the problematic controller of course). Sorry about all this work, but it really helps a lot with finding the cause and a solution for this problem :slight_smile:

Input.hx (20.9 KB)

Edit: looks like vendor and ID aren’t implemented in Krom and always return unknown (source), but the debug output of the gamepad sticks is still of interest.

I dropped the modified Input.hx file in the directory /iron/Sources/iron/system/Input.hx and I tried again in Krom and we have results in the console coming from the left stick of the controller (up stick, down stick, left stick, right stick). On the other hand, we still have the same problem, that is to say that the cube does not move forward (down stick and right stick) and the up stick is mapped on the down stick. I tried again in HTML on the browser and the stick works perfectly regardless of direction. I don’t know if it’s an Armory bug that has difficulty recognizing Xbox controller sticks on Krom or if