Mobile Controls Kit

Complete touch input system for any mobile Unity game — virtual joystick, on-screen buttons, swipe gestures, pinch-to-zoom, gyroscope, and safe area handling.

Setup
1. Import all scripts into your Unity project
2. Create a UI Canvas and add TouchJoystick to a child Image element
3. Add TouchButton components for action buttons (jump, attack, etc.)
4. Attach SwipeInputController to a manager for gesture detection
5. Add PinchToZoomCamera to your main camera for zoom support
6. Add a full-screen panel under the Canvas, attach MobileSafeArea to it, and put the controls inside it

If something does not work
- The joystick and buttons do not respond to touch: They use Unity UI pointer events, so the scene needs an EventSystem and the Canvas a Graphic Raycaster. Make sure no other full-screen UI image with Raycast Target on sits above the controls.
- Controls sit under the notch or home bar: Put MobileSafeArea on a full-screen panel under the Canvas and make the controls its children. It resizes that panel to Screen.safeArea, so anything outside the panel is not protected.
- The gyroscope camera does nothing: It checks SystemInfo.supportsGyroscope and stays still on devices without one, including the Editor and most tablets without motion sensors. Test on a phone.
- Every input call throws InvalidOperationException in a new Unity 6 project: The scripts read the legacy Input class, which new Unity 6 projects switch off. Set Project Settings > Player > Active Input Handling to Both and let the Editor restart. Details and the Input System alternative.

Source: https://scriptsforunity.com/game-systems/mobile-controls-kit/
License: MIT
