Controller support
Controller support
It would be nice to play the game with a controller, since the control scheme would fit on there as well. I thought I'd open a thread here to discuss this, since I can't open an issue on github. I tried to implement it by myself, but seems be non-trivial.
-
- Posts: 56
- Joined: Sun Feb 02, 2014 4:16 am
- Location: A benificery of the 'glorious' US Empire.
Re: Controller support
as a stop-gap, emacs?
-
- Posts: 713
- Joined: Sat Apr 20, 2013 9:44 am
- Location: GerMany
Re: Controller support
If you have the project opened in unity, you can reassign the keys in project settings -> input, but i dont know how the thumb sticks are handled
Re: Controller support
As mentioned I already tried to implement it and the current code coesn't support controllers per se.
The view sticks are not resseting which results in a strafing for the movement and view.
The view sticks are not resseting which results in a strafing for the movement and view.
-
- Posts: 713
- Joined: Sat Apr 20, 2013 9:44 am
- Location: GerMany
Re: Controller support
i dont know how far you have it working so here goes how to do it:
the buttons are easiest, go to edit ->project settings -> input, then on the right simply put the controller button you want as alternate input: the button numbers are like on this image: http://wiki.unity3d.com/index.php?title ... Controller
for the cam rotation first right-click the mouse x input and duplicate it, then change type to joystick axis and axis to x axis and maybe sensitiviy to 1 (never over 1! adjust it in the esc-screen or multiply it in the script) and dead zone to 0.1
then do the same with the y axis
for walking, duplicate these and set the axis to 4th and 5th, i named them "Controller Vertical" and "Controller Horizontal"
you should check the invert checkbox on controller y and controller vertical they dont work yet, you have to grab these inputs in the script.
go on the bottom left to scripts, them open aimscript and search for "mouse x"
you have to add the controller axis so you add
beneath the mouse axis lines
and a few lines beneath
for walking, go in FPSInputController.js and replace line 15 with
save your script files and run the game, it should be working now
running doesnt work like this, maybe map the alternate positive button in horizontal input to a controller button, then you can tab it quickly to run
if you tell me where you want which buttons ill add these to my receiver mod.
the buttons are easiest, go to edit ->project settings -> input, then on the right simply put the controller button you want as alternate input: the button numbers are like on this image: http://wiki.unity3d.com/index.php?title ... Controller
for the cam rotation first right-click the mouse x input and duplicate it, then change type to joystick axis and axis to x axis and maybe sensitiviy to 1 (never over 1! adjust it in the esc-screen or multiply it in the script) and dead zone to 0.1
then do the same with the y axis
for walking, duplicate these and set the axis to 4th and 5th, i named them "Controller Vertical" and "Controller Horizontal"
you should check the invert checkbox on controller y and controller vertical they dont work yet, you have to grab these inputs in the script.
go on the bottom left to scripts, them open aimscript and search for "mouse x"
you have to add the controller axis so you add
Code: Select all
rotation_x += Input.GetAxis("Controller X") * sensitivity_x;
rotation_y += Input.GetAxis("Controller Y") * sensitivity_x;
and a few lines beneath
Code: Select all
view_rotation_x += Input.GetAxis("Controller X") * sensitivity_x;
view_rotation_y += Input.GetAxis("Controller Y") * sensitivity_x;
Code: Select all
var directionVector = new Vector3(Input.GetAxis("Horizontal") + Input.GetAxis("Controller Horizontal"), 0, Input.GetAxis("Vertical") + Input.GetAxis("Controller Vertical"));
running doesnt work like this, maybe map the alternate positive button in horizontal input to a controller button, then you can tab it quickly to run
if you tell me where you want which buttons ill add these to my receiver mod.
Re: Controller support
There's also a program called JoyToKey which enables Gamepad to Keyboard/Mouse input.
-
- Posts: 713
- Joined: Sat Apr 20, 2013 9:44 am
- Location: GerMany
Re: Controller support
yeah but you wouldnt have to do all the things which would be kindof lameTimbles wrote:There's also a program called JoyToKey which enables Gamepad to Keyboard/Mouse input.
Re: Controller support
As mentioned, the camera stick can't function. I just used my PS3 controller (setup by MotionInJoy,) and I enabled the automatic camera option, so I was always looking in the direction I was moving. It was just taste, but I can tell that I'll like this game more with the controller support!