Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

Loading my own control scheme

A topic by arvz created May 25, 2018 Views: 105 Replies: 2
Viewing posts 1 to 2

Hey Sophie!

Sinput comes with a default MainControlScheme, and it looks like that gets loaded up by default. If I create my own control scheme, say 'MyControlScheme', how do I load that in my script? 

Looking through Sinput.cs, MainControlScheme gets loaded up by calling 

LoadControlScheme("MainControlScheme", loadCustomControls);

I'm guessing we need to call this function ourselves in our script at some point? But does this mean every time a game loads the MainControlScheme gets loaded every time before our own scheme gets loaded after? If that's true it doesn't seem very optimal to have to load both schemes every time


Hey arvz!

The idea is that eventually you will be able to call LoadControlScheme() passing the name of your scheme or a reference to the scheme asset. Right now tho, as you've noticed the whole initialisation process is... kind of a mess and inefficient too.

Looking into the initialisation process and being able to swap various control schemes are big parts of my priority to-do list but I don't know when they will be done. ngl they are kind of daunting and I can't remember enough off the top of my head about how either works right now to be able to tell you what would be a good way to hack what you want (sorry!)

hopefully I'll get them done soon but for the time being sub-optimal messy rubbish is the best option (and heads-up if you do have multiple control schemes now, player custom bindings for them are probably not gonna be saved reliably)

aaaaaaah I wish this bit worked for you but it's just one of the little corners of the system that hasn't been worked on enough yet ^_^;

No worries! What you've got working here is already a vast improvement over what vanilla Unity input system gives you. I'm just starting a new project now so this is more than good enough for now.