1
$\begingroup$

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!

$\endgroup$
1
$\begingroup$

I think you can use the Joystick sensor; However, you do have to configure it accordingly, using the button and axis numbers.

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ @CrazyPoo Glad I helped; If it solves your problem, you can upvote (up arrow) and accept (the check mark under the arrows) my answer ;D $\endgroup$ – someonewithpc Jan 3 '15 at 19:19
  • $\begingroup$ elysiun.com/forum/… $\endgroup$ – Crazy Poo Jan 3 '15 at 21:09
0
$\begingroup$

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...enter image description here
  • When you play it, you'll be able to rotate cube with left stick and jump with A button!
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.