Why Mobile Game Development?
Mobile gaming is the largest gaming platform in the world — bigger than PC and console combined. Over 3 billion people play mobile games. In Pakistan, mobile gaming is growing fast, and Pakistani developers can publish globally and earn in USD. A well-made casual game with ads can start earning within days of publishing.
🤖 Android Google Play
Easiest platform to start. $25 one-time Google Play account fee. Publish within 1–3 days. Pakistani developers supported via Payoneer. Largest market in Pakistan.
- Build format: AAB (App Bundle)
- Min SDK: Android 6.0+ (API 23)
- Revenue: AdMob, Play Billing
- Review time: 1–3 days
🍎 iOS App Store
Larger revenue per user. $99/year Apple Developer account. Requires a Mac for final build (or use cloud build services). More strict review process.
- Build format: IPA
- Min iOS: 13.0+
- Revenue: AdMob, StoreKit
- Review time: 1–7 days
Setting Up Unity for Android — Complete Guide
Install Android Build Support
Open Unity Hub → Installs → click the gear icon next to your Unity version → Add Modules → check Android Build Support (includes Android SDK & NDK Tools and OpenJDK). Unity installs everything automatically — no separate SDK download needed.
Configure Player Settings
Go to File → Build Settings → Android → Player Settings. Set these important values:
| Setting | Recommended Value | Why |
|---|---|---|
| Package Name | com.YourName.GameName | Unique identifier on Play Store |
| Version Code | 1 (increment each update) | Required by Play Store for updates |
| Minimum API Level | API 23 (Android 6.0) | Covers 99%+ of active devices |
| Target API Level | Latest (API 35) | Required by Google Play policy |
| Scripting Backend | IL2CPP | Better performance than Mono |
| Target Architectures | ARM64 only | Required for 64-bit Google Play |
| Strip Engine Code | Enabled | Smaller APK size |
Build AAB for Google Play
In Build Settings, check "Build App Bundle (Google Play)" then click Build. This creates a .aab file. For testing on your own device, uncheck that option to build an APK instead. Always use a Keystore for signing — create one via Player Settings → Publishing Settings → Keystore Manager. Save your keystore password safely — you need it for every update.
Mobile Performance Optimization
Mobile devices have limited CPU, GPU, and RAM compared to PC. Poor performance causes bad reviews and uninstalls. These are the most important optimizations for mobile games:
Textures
- Use ETC2 compression for Android (set in Texture Import Settings)
- Keep texture sizes at 512×512 or 1024×1024 maximum for most assets
- Use Sprite Atlases (sprite sheets) to batch draw calls — this is the single biggest performance improvement for 2D games
- Disable Read/Write Enabled on textures you don't access from code
Audio
- Set background music Load Type to Streaming
- Set short sound effects Load Type to Decompress On Load
- Use MP3 for Android, AAC for iOS
- Reduce audio sample rate to 22050 Hz for sound effects (you won't hear the difference)
Draw Calls & Batching
- Target under 50 draw calls per frame on mobile
- Enable Static Batching for non-moving objects in Player Settings
- Enable Dynamic Batching for small moving objects
- Use GPU Instancing for objects that repeat many times (trees, coins, enemies)
- Minimize use of transparent materials — they are expensive on mobile GPUs
Code & Scripts
- Avoid using Find() and GetComponent() inside Update() — cache references in Start()
- Use Object Pooling for frequently spawned objects (bullets, coins, enemies)
- Avoid garbage collection spikes — don't create new objects every frame
- Use StringBuilder instead of string concatenation in Update()
Integrating AdMob in Unity — Step by Step
AdMob is the most important SDK for mobile game monetization. Here is the complete integration guide:
- Create AdMob account — go to admob.google.com and sign up with your Google account. You need an AdSense account linked for payments.
- Add your app — in AdMob dashboard, click Add App → Android → enter your app name (it doesn't need to be published yet for testing). Copy your App ID (format: ca-app-pub-XXXXXXXX~XXXXXXXXXX).
- Create ad units — create separate ad units for each ad type you want: Banner, Interstitial, Rewarded. Copy each Ad Unit ID.
- Download Google Mobile Ads SDK — get the Unity Plugin from github.com/googleads/googleads-mobile-unity → Releases → download the latest .unitypackage file.
- Import into Unity — Assets → Import Package → Custom Package → select the .unitypackage. Import everything.
- Set App ID — go to Assets → Google Mobile Ads → Settings → paste your AdMob App ID for Android.
- Initialize SDK — in your first scene's script, call: MobileAds.Initialize(initStatus => { }); in Start() or Awake().
- Load and show ads — use test ad unit IDs during development. Never click your own real ads — this gets your account banned.
Banner: ca-app-pub-3940256099942544/6300978111
Interstitial: ca-app-pub-3940256099942544/1033173712
Rewarded: ca-app-pub-3940256099942544/5224354917
Publishing on Google Play — Complete Checklist
- Create developer account — play.google.com/console → $25 one-time fee. Pay via international debit card or Payoneer virtual card.
- Set up payments — link your Payoneer account to Google Payments before you publish. Go to Payments profile in Play Console and add your Payoneer bank details.
- Create new app — click "Create app" → enter app name, language, app/game type, free/paid.
- Upload AAB — go to Production → Releases → Create new release → upload your .aab file.
- Store listing — add title (max 30 chars), short description (max 80 chars), full description (max 4000 chars), at least 2 screenshots (min 320px), and a feature graphic (1024×500px).
- Content rating — complete the IARC questionnaire under Policy → App content → Content ratings.
- Privacy policy — required for all apps. Add a link to your privacy policy page (you can use the one at gamecraftpk.xyz/privacy-policy as reference).
- App access — declare if your app requires login or special access. For most casual games, select "All functionality is available without special access".
- Submit for review — click "Send for review". New apps take 3–7 days for first review.
Touch Input in Unity — Code Reference
Detect Single Tap
Use Input.GetMouseButtonDown(0) — works for both touch and mouse. Simple and works in Unity without extra code. For multi-touch use Input.touchCount and Input.GetTouch(0).
Swipe Detection
Record touch start position on TouchPhase.Began, compare with position on TouchPhase.Ended. Calculate direction vector to determine swipe direction (up, down, left, right).
UI Buttons vs Input
For simple games, use Unity UI Buttons (EventSystem) instead of raw touch input. Buttons automatically handle touch and are much easier to implement correctly. Use raw touch input only for gestures (swipe, pinch, hold).
Screen Resolution & UI for Mobile
Mobile devices have many different screen sizes and aspect ratios. Your UI must work on all of them:
- Set Canvas Scaler to Scale With Screen Size — Reference Resolution 1080×1920 for portrait, 1920×1080 for landscape
- Use Anchor Points on all UI elements — anchor buttons to corners, health bars to top, scores to top-center
- Test on at least 3 different aspect ratios in Unity: 9:16, 9:19.5, and 9:21 (tall phones)
- Leave safe zones for phone notches and bottom navigation bars — use Unity's Screen.safeArea API
- Minimum touch target size: 44×44 points — fingers need enough room to tap accurately