Hello!
So I am making my first game that I’m planning to post on ios/android. I’m wondering how I can make controls in the game for the phone, but also be able to test it on Unity.
I am a beginner so I don’t quite know how this stuff works yet.
There’s no magic to it; make up a control scheme for the touch screens, and if that’s hard to test on the desktop with a mouse, then add alternate keyboard controls. If you want, you can even leave those in as a hidden feature for anybody who happens to have a Bluetooth keyboard on their iOS/Android device.
You can use platform dependent compilation to use 2 different control schemes depending on your platform Unity - Manual: Conditional compilation. A small example would be:
public class ControlExample : MonoBehaviour {
private void Update () {
#if UNITY_EDITOR // If testing your code in Unity this code would run.
// Your Unity controls go here
#else // Otherwise this code would run.
// Your mobile controls go here
#endif
}
}
1 Like
Thanks for both of your answers. I also found a tutorial on Unity for mobile so I will try theses out.
Thanks!