Since we’d love to implement split screen and 4 player support into Warsoup, I’ve been fiddling around a bit with controller support. Now, I don’t really get how to set this stuff up properly at the moment, haven’t spent too much time on it.
The problem is that I can use then input manager and set up one controller, but if I change the axes to support the ‘joystick’, the mouse won’t work anymore.
Also, are there any guides or hints out there on how to add multiple controller support? At some point our programmer will go over all of this anyway, but I’d love to know a little more about how to do this sorta stuff in Unity and how to set-up controls properly, etc.
The Input Manager to me looks quite messy, I can’t seem to figure out how to add new controls, etc. The way I see it, the Input Manager should make it easy to add new controls and set them up to input devices and then you’d just refer to those controls within your scripts. Yet I’m sitting here for 10 minutes not being able to figure out how to add new controls - Also, in the Unity Configuration window once you created a runtime, shouldn’t that thing support DirectInput? So that I can customize ‘forward’ to be some axis of my controller?
Has this stuff been changed in Unity 3.0? I guess since it supports more platforms now, like x360 and PS3, this stuff should be much more streamlined.
I honestly haven’t been too pleased with how the input manager is handled (entirely too much error-prone faffing about with the interface). As you’ve realised, handling multiple can be a bit of a nightmare. This doesn’t appear to have improved with 3.0, judging from the betas.
Accessing the defined inputs via script is less of a hassle, as long as you take into account the various control schemes available (though this is good practise regardless).
Now with regards to your last question, while working with Unity Wii, since I was dealing with multiple controllers, I ended up not using the input manager at all, and relying on the Wii-specific input methods (basically rolling my own albeit rudimentary input manager). Working with a single controller/player, it’s pretty trivial to use the input manager, but it becomes a complete nightmare when working with more.
It should be a simple matter of connecting the controllers to your PC, defining controls, assigning the controls through directInput and then using those controls as events in scripts - done.
I’ll have our programmer go over this, but this is exactly the stuff that Unity should be able to do with ease out of the box without needing someone spending a day to code it all together.
To be fair, most of the basic inputs are already represented in the API (Input.GetAxis(“Horizontal”), etc). It’s just a bit of a hassle when you need to add additional axes (eg. triggers on the 360 controller), or worse, add controller support for two or more players.