Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Integrating new hardware into Unity (Controllers? Peripherals?)

Discussion in 'General Discussion' started by I_CAST_FIST, Mar 14, 2016.

  1. I_CAST_FIST

    I_CAST_FIST

    Joined:
    Jun 16, 2014
    Posts:
    2
    A general question that I cant quite seem to fit into any other sub-forum, does anyone know much about integrating new hardware into unity? Specifically controllers but honestly if anyone can point me in the direction of even the smallest example to oogle and marvel at it'd be most appreciated.

    I'm not talking about xbox 360 controllers either, I mean if i sat down threw circuits, metal and soft leather grips into a salad bowl and tossed it around until I got a DIY controller with 18 knobs and the yellow spinny bit from a Bop-it; How would I rig unity to handle the inputs of it? Accelerometers and Gyroscopes all seem to be functioning in it, It maps to a phone pretty well, does anyone know much about the process of it?

    I'm not expecting to plug my sparking monstrosity in and type up input.flippyBit == sword.motion and for it to work, just some theory crafting and if possible specifics would be a lovely bit of fun to play around with over the summer this year.

    Cheers for reading!
     
  2. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,956
    Most controllers, including some of the bizarre ones like the Wii's Remote, simply register themselves as joysticks. Any part that has a simple on/off would be a button and anything with a range of values would be an axis. Then it would simply be a matter of mapping those in Unity.
     
    Martin_H likes this.
  4. I_CAST_FIST

    I_CAST_FIST

    Joined:
    Jun 16, 2014
    Posts:
    2
    You're right, found an interesting if dusty part of unity's documentation concerning Input mapping, as far as im aware all the hard work is done by the accelerometers and gyroscopes hardware and just feeds in a value and simple events for buttons like you said.

    http://docs.unity3d.com/ScriptReference/Input.html

    And after having a look at makey makey and searching around for more flexible kits for truly outlandish design I came across this beautiful human being and his video on making a retro controller from scratch, soldering circuits and all -

    https://learn.adafruit.com/diy-bluetooth-gamepad/overview

    That said, thankyou both for your input - this already looks alot more doable (and cheaper) than I Initially thought it'd be. I'll be back in a few months hopefully with a prototype of the goofiest controller you've ever seen if all goes well, just to push the Input limits. Also thankyou for that wii remote tip, that helped alot :)
     
    Ryiah likes this.