I am making a game on Windows with BGE and was trying to add a controller instead of a mouse and keyboard. I cant seem to get blender to recognize the buttons on the controller when I press them like I would with a keyboard or mouse. Is it supposed to recognize that or is my controller driver not working properly? Help would be awesome!
Yes it's possible! Just make sure and calibrate your controller first just to be safe. You need logic bricks, python script and game object (player and ground) to see the results bge-style. Follow these instructions to see how to rotate the cube and make it jump. Okay, let's assume we're starting a new Blender project using the original startup. (I'm using Blender 2.66a for 64bit windows 7 and an XBox 360 wired controller).
- Prepare the scene - In the 3d view window, add a plane mesh object and scale it will be the ground. So now we have Camera, light, plane and cube. Then select the cube, in the property's window switch the physics type from static to dynamic.
- Prepare the bricks - Then in the logic editor window add one ray sensor, two joystick sensors and one python controller for that cube we selected. Name the ray sensor (I'll be naming mine "Ground"), True & Neg Pulse On, -Z Axis, Range 1.0. Then name the Joystick Sensors (mine will be "Leftstick" and "Jump"). Here's the settings for joystick sensor named "Leftstick"-True Pulse on, Event type: Axis, Axis Number: 1 and all events enabled. Next is "Jump"'s settings-Just simply select Tap. Then link all sensors to the python controller brick.
- Prepare the code - In the text editor window add a New script and name it. Back in the logic window, in the python controller brick, select your new script. Go back to the text editor window to write the script. The script should look something like this...
- When you play it, you'll be able to rotate cube with left stick and jump with A button!