playMaker

Author Topic: Using Nintendo switch controllers with unity  (Read 3650 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 336
Using Nintendo switch controllers with unity
« on: June 24, 2021, 01:01:07 AM »
Hello,

How would I go about hooking up a Nintendo switch controller to be able to use it with unity? I think I know that it would hook up through Bluetooth but would I use get button down actions still and would there be any other additional steps? Please explain in as much detail as possible as I’ve never attempted to do this before. Thanks! Also would it be the same process for other systems such as Xbox and PlayStation? Thanks again!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Using Nintendo switch controllers with unity
« Reply #1 on: June 24, 2021, 08:34:34 AM »
Hi.
Best is to use Rewired Asset
Especially if you want to support different kind of controllers.

misterjuly

  • Sr. Member
  • ****
  • Posts: 336
Re: Using Nintendo switch controllers with unity
« Reply #2 on: June 24, 2021, 02:22:41 PM »
Is there a way to do it without the asset? It costs $45 and I don’t really want to spend that money on it. Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Using Nintendo switch controllers with unity
« Reply #3 on: June 24, 2021, 03:24:08 PM »
Hi.
Have you tried to connect a switch controller if unity sees the controller?
i can not test this since i don't have a switch controller.

For which platform are you building?

misterjuly

  • Sr. Member
  • ****
  • Posts: 336
Re: Using Nintendo switch controllers with unity
« Reply #4 on: June 24, 2021, 04:09:45 PM »
I have not tested it yet, but will test it when I get home. About what system I’m building for I’ll be honest I haven’t decided for sure yet, but am leaning towards PC/MAC and/or Switch. I will let you know how the controller works when I’m home. Thanks for your help!

misterjuly

  • Sr. Member
  • ****
  • Posts: 336
Re: Using Nintendo switch controllers with unity
« Reply #5 on: June 24, 2021, 07:15:22 PM »
I got the controllers hooked up and my characters are moving left and right with the analog stick. However, when I set up the jump button, no matter which controller I use, both characters jump at the same time. It should be noted I am using Unity's original input system. Is it worth it to use the newer one? Would this give me more control? And if so how is it compatible with Playmaker? Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 336
Re: Using Nintendo switch controllers with unity
« Reply #6 on: June 24, 2021, 08:23:41 PM »
With some research, I figured it out! Thanks for your help!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Using Nintendo switch controllers with unity
« Reply #7 on: June 25, 2021, 07:22:32 AM »
Hi.
Just so you know in advance.

For switch you need to get a Nintendo Switch Developer Kit which cost approximately $450.

for PC/Mac people use different types of controllers (Xbox / Playstation / Steam controller / etc)
These controllers have different layouts. so you would need to build a system to detect which controller is used to set the correct default buttons.
also you will need to setup a Ui where player can change their button layout.
which is a lot of work and not easy to do with unity's input system.

This i why for controls i always recommend  Rewired.

rewired has a template for players to change their buttons
and it supports most controllers
also it support plug and play (conecting controller while playing, changing controller while playing etc.)

You can use unity's for now and change later (when you project is close to release for example)
Just make sure you know where all the input system actions are and you should be able to replace

misterjuly

  • Sr. Member
  • ****
  • Posts: 336
Re: Using Nintendo switch controllers with unity
« Reply #8 on: June 25, 2021, 05:12:11 PM »
Ok. Thanks for the info. I'll definitely keep it in mind. Thanks again!