Android Controls - Unity 3D Course

Please could anyone help me with android controls? I’m doing “Section 3: Project Boost” but I decided to be a little adventurous and deviate slightly from the instructions. I wanted to make my game for Android where I could tap/hold my finger on the screen to fly and tilt my phone to make the rocket rotate.

To do this, I imported the new input system package and used the following code…

I have been using the Unity Remote 5 app on my phone to test my game and I was really pleased to find it all worked perfectly. Tapping/holding my finger on the screen causes the rocket to fly and tilting my phone causes the rocket rotate. However, now that I have built the game into an APK file and installed it on my phone, I have found that the controls no longer work at all. Nothing happens when I touch the screen or tilt my phone. Very disheartening :frowning:

Please can anybody help me fix this?

not sure if that will help you but you know you don’t need the Unity Remote 5 to test your game… there is now a simulator directly in Unity, so you can see how it plays there. And then you can set the input options to simulate mouse clicks as touches…

… more details on the Dapper Dino course for mobile development here at GameDev.TV

EDIT: and Welcome to You :slight_smile:

I wont be able to test the accelerometer in the simulator. I’m really confused, I can’t seem to find any solutions to this online. It makes no sense to me that it would detect the touch and accelerometer through Unity Remote 5 but not when running natively on the phone.

Update: I finally found a solution after many hours of scratching my head!

I went to Project Settings > Player > Other Settings and I changed the Active Input Handling to “Both”. I have no idea why this was necessary since I’m only using the new input system but whatever! It works now!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms