Issue with crossplatforminput and mobile controllers prefabs

Hello,

I just wanted to share a weird experience I just have and ask question. I was working on my small little game and I wanted to add mobile input to test it on my phone. All went fine, test with Unity remote on android works well when I drag the ‘joystick’ my player moves (yiha !)
But when I build the app and try to play the joystick drag doesn’t work anymore but other buttons work …
I’ve made search and test and nothing seems to work until I’ve got the idea to remove my base UI canvas (with info text, menu button …). So now it works but I don’t know why my other canvas block the controller canvas only for drag and only on builded version of the game.

Did someone experienced this ? How can I solve that without removing my other canvas ?

I have other ideas, and still have tests to run but if someone has suggestions I’ll take them :wink:

Seeya.

edit : more informations after a new test, I got something. The 2nd Canvas wasn’t the problem.
If I build and launch the game scene only, it works, if I build the full game with splash, menu and game, it doesn’t work.
I have this error message for both axis :

There is already a virtual axis named Horizontal registered.

Going with that, I’ve add a log on create axis method of standard asset CrossPlatformInputManager.cs and saw that this script is called once startMenu scene appear …
So I have to find a way to block execution on start menu or to avoid execution after.

Finally found the solution here : https://answers.unity.com/questions/1005113/there-is-already-a-virtual-axis-named-x-registered.html

Adding a conditional to check virtual axis existence, It’s working, it’s working !

1 Like

Please add [SOLVED]

Privacy & Terms