Creating a shooter for Android on the engine Unity is a fascinating process that may seem difficult to beginners, but with the right approach it becomes accessible even to novice developers. Mobile shooters remain one of the most popular genres in Google Playand Unity provides all the necessary tools for implementing dynamic gameplay, physics and visual effects. In this article we will look at the entire path - from installing the engine to optimizing the game for weaker devices and publishing it in the store.
It is important to understand that a successful shooter for Android requires not only technical implementation, but also thoughtful level design, balance of complexity and convenient controls. We will look at key aspects: setting up the project for mobile devices, working with assets, programming shooting and movement mechanics, as well as testing on real devices. If you have never worked with Unity, do not worry - the article contains step-by-step guide with explanations for each stage.
We will pay special attention to optimization, since mobile devices have limited resources compared to PCs. You will learn how to reduce the load on the processor, configure the graphics correctly, and avoid common mistakes that lead to low FPS or overheating of the smartphone. At the end of the article - tips on monetization and promotion of the game so that your shooter not only works, but also generates income.
1. Preparing the working environment: installing Unity and the necessary tools
Before you start creating a game, you need to set up the working environment. Let's start with installation Unity Hub โan official project manager that simplifies working with different versions of the engine. Download it from official website and install following the instructions. After installing:
- ๐ฅ Download the latest stable version Unity (recommended 2022 LTS or later).
- ๐ฑ Install the module
Android Build Supportvia Unity Hub (includingOpenJDK,Android SDKandNDK). - ๐ง Check for Java Development Kit (JDK) version 11 or higher.
- ๐ฎ Install Visual Studio Code or Rider to edit scripts on
C#.
After installation, create a new project in Unity Hub, selecting the template 3D Core. Name the project (for example, MobileShooter2026) and specify the folder to save. Important: the first time. startup Unity will ask you to log in - use your account Unity ID (free plan Personal suitable for beginners).
โ ๏ธ Attention: If you work on macOS, make sure you have it installed Xcode (for assembly under iOS, if you plan multiplatform). For Android you will also need to set up environment variablesJAVA_HOMEandANDROID_HOME.
Before starting development, check the project settings:
- Go to
Edit โ Project Settings โ Player. - In section
Other SettingsinstallScripting Backendon IL2CPP (optimal for Android). - In
IdentificationspecifyPackage Namein formatcom.yourname.gamename. - In
Resolution and Presentationselect orientation Portrait or Landscape (for shooters usually Landscape).
2. Game design: choice of mechanics and prototyping
Before writing code, decide on main mechanics your shooter. Mobile games are divided into several types:
- ๐ฏ Top-Down Shooter (top view, example: Hotline Miami).
- ๐๏ธ First-Person Shooter (FPS) (first person, example: Modern Combat).
- ๐ฎ Dual-Stick Shooter (joystick control, example: Dead Trigger 2).
- ๐ Bullet Hell (mass attacks of enemies, example: Danmaku Unlimited).
For the first project, we recommend choosing Top-Down Shooter or Dual-Stick Shooter โthey are easier to implement and are well suited for touch controls. Create a prototype of the level on paper or in a graphic editor (for example, Aseprite or Photoshop), noting:
- Location of the player and enemies.
- Coverage areas and obstacles.
- Enemy spawn points (spawn points).
- NPC movement trajectories.
B Unity Start by creating a simple scene:
- Add
Plane(floor) and scale it to the size of the level. - Create
Cubeas a temporary player and assign a tag to itPlayer. - Add several
CapsuleorSphereas tagged enemiesEnemy.
Use ProBuilder (built into Unity) to quickly prototype levels. It allows you to create and edit 3D meshes directly in the editor without exporting from external apps.
3. Programming basic mechanics: movement, shooting and collisions
Now let's move on to the code. The main scripts that will be needed for the shooter:
| Script | Purpose | Key methods |
|---|---|---|
PlayerMovement.cs |
Player movement control | Update(), FixedUpdate(), Input.GetAxis() |
PlayerShooting.cs |
Shooting and reloading mechanics | Instantiate(), Raycast, Coroutine |
EnemyAI.cs |
Logic of enemy behavior | NavMeshAgent, OnCollisionEnter() |
HealthSystem.cs |
Health and damage system | TakeDamage(), Die() |
Consider an example code for player movement with touch controls (suitable for Dual-Stick Shooter):
using UnityEngine;using UnityEngine.EventSystems;
public class PlayerMovement : MonoBehaviour
{
[SerializeField] private float moveSpeed = 5f;
[SerializeField] private Joystick joystick;
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
Vector3 moveDirection = new Vector3(joystick.Horizontal, 0, joystick.Vertical);
rb.velocity = moveDirection * moveSpeed;
}
}
For shooting, use Raycast (ray physics) or Instantiate (creating bullets as objects). Example of firing with a delay:
using UnityEngine;public class PlayerShooting : MonoBehaviour
{
[SerializeField] private GameObject bulletPrefab;
[SerializeField] private Transform firePoint;
[SerializeField] private float fireRate = 0.5f;
private float nextFireTime = 0f;
void Update()
{
if (Input.GetButton("Fire1") && Time.time >= nextFireTime)
{
Shoot();
nextFireTime = Time.time + fireRate;
}
}
void Shoot()
{
Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
}
}
โ ๏ธ Attention: When using Instantiate for bullets, be sure to configure Object Pooling to optimize. Creating and destroying objects in real time leads to lags on weak devices.
To handle collisions (for example, when a bullet hits an enemy), use the method OnCollisionEnter:
void OnCollisionEnter(Collision collision){
if (collision.gameObject.CompareTag("Enemy"))
{
Destroy(collision.gameObject); // Destroy the enemy
Destroy(gameObject); data-i="138">Player movement across the screen|Firing with a delay|Collision of bullets with enemies|Destroying objects when hit-->
}
}
Player movement across the screen|Firing with a delay|Collision of bullets with enemies|Destruction of objects when hit-->
4. Optimization for Android: reducing load and increasing FPS
Mobile devices have limited resources, so optimization is a critical stage:
- ๐ผ๏ธ Use texture atlases (
Sprite Atlas) to reduce the number of draw calls. - ๐จ Set
Texture Compressionto ASTC (optimal for Android). - ๐ Disable
Real-time Shadowsand use baked shadows (Baked Lighting). - ๐ Reduce the number of polygons in 3D models (goal: no more than 500-1000 polygons per object).
Graphics quality settings in Unity:
- Go to
Edit โ Project Settings โ Quality. - Create a new quality level for Android (for example,
MobileLow). - Disable
Anti Aliasing, reduceShadow Distanceto 10-15. - Install
VSync Counton Donโt Sync (for maximum FPS).
Critical for performance: disable unnecessary components in Player Settings โ Splits Application Binary (reduces APK size) and install Target Architecture on ARM64 (most modern Android devices).
To optimize physics:
- Use
Fixed TimestepinTime Manager(optimally: 0.02). - Disable
Gravityfor objects that do not need physics (for example, decorations). - Replace
OnCollisionEnterwithOnTriggerEnterwhere physical reaction is not needed.
How to check FPS in real time?
Enable Stats in Game View (button in the upper right corner). If FPS is below 30 on the target device, additional optimization is required.
5. Control and interface: adaptation to touch input
Control in mobile shooters should be intuitive. To do this, use:
- ๐ฎ Virtual joystick (for example, Joystick Pack from Asset Store).
- ๐ Action buttons (jump, reload, change weapons).
- ๐ Auto-aim (makes shooting easier on small screens).
- ๐ฑ Gestures (for example, swipe to dodge).
To create a joystick:
- Import a free package Joystick Pack from Asset Store.
- Add a prefab
Fixed Joystickto the scene. - Configure script
PlayerMovement.csfor working with a joystick (code example is given above).
The interface (UI) must be adaptive. Use Canvas Scaler with settings:
UI Scale Mode: Scale With Screen Size.Reference Resolution: 1920x1080 (standard for Full HD).Screen Match Mode: Match Width Or Height (value 0.5).
Example of creating a shooting button:
- Create
Buttonin Hierarchy (right mouse button โUI โ Button). - Assign a script with a method to it
Shoot(). - Place the button in the lower right corner (typical location for shooters).
โ ๏ธ Attention: Test controls on real devices, not just editor. Emulators (for example BlueStacks) do not always accurately convey touch input.
6. Testing and debugging on real devices
Testing on a Androiddevice - mandatory step. To do this:
- Connect your smartphone to the PC via USB and turn on Developer mode (
Settings โ About phone โ Build number- press 7 times). - Enable
USB debuggingin the developer settings. - In Unity go to
File โ Build Settings, select Android and clickBuild And Run.
Checklist for testing:
FPS stability (at least 30)|Correct operation of controls|No crashes during long-term play|Correct display of UI at different resolutions-->
Common errors and their solutions:
| Problem | Possible reason | Solution |
|---|---|---|
| The game lags on weak devices | Too many objects or heavy graphics | Reduce the number of polygons, use Object Pooling |
| Control does not work | Input or UI is incorrectly configured | Check EventSystem object layers |
| Textures are blurry | Incorrect settings import | Install Filter Mode on Bilinear |
| The game does not start on the device | Incompatible version Android or Unity | Check Minimum API Level in Player Settings |
To collect error logs, use Android Logcat (built into Unity when the device is connected) or ADB:
adb logcat -s Unity
7. Build and publish on Google Play
When the game is ready, start assembling .apk or .aab (recommended format for Google Play):
- Go to
File โ Build Settings. - Select Android and click
Player Settings. - Install
Bundle Version CodeandBundle Version Name(for example, 1.0). - Enable
Split Application Binaryto reduce file size. - Click
Buildand save the file to a folder.
For publication in Google Play Console:
- ๐ Register as a developer (one-time payment $25).
- ๐ฆ Upload
.aab-file to section Production. - ๐ผ๏ธ Add screenshots (requirements: 1920ร1080, without UI elements).
- ๐ฅ Upload a promotional video (optional, but increases conversion).
- ๐ Fill in the description, keywords and category (for example, Action).
โ ๏ธ Attention: Before publishing, check compliance Google Play rules (for example, the presence of a privacy policy if the game collects data).
After publication, monitor reviews and metrics in Google Play Console. Use Firebase Analytics to track player activity and optimize monetization.
Publish the game in .aabrather than .apk โthis reduces download size and speeds up updates.
8. Monetization and promotion of the game
There are several ways to monetize a mobile shooter:
- ๐ฐ Advertising (through Unity Ads, AdMob or AppLovin).
- ๐ In-app purchases (skins, weapons, bonuses).
- ๐๏ธ Premium version (payment per download).
- ๐ Battle pass (monthly subscription with rewards).
To integrate advertising:
- Import the package Unity Monetization from Asset Store.
- Configure the placement of banners and interstitial advertising in the pause menu.
- Use rewarded ads (rewarded ads) for bonuses (such as extra lives).
Example code for showing interstitial ads:
using UnityEngine;using UnityEngine.Advertisements;
public class AdManager : MonoBehaviour, IUnityAdsLoadListener, IUnityAdsShowListener
{
[SerializeField] private string androidAdUnitId = "your_id_here";
void Start()
{
Advertisement.Load(androidAdUnitId, this);
}
public void ShowAd()
{
Advertisement.Show(androidAdUnitId, this);
}
// Implement the IUnityAdsLoadListener and IUnityAdsShowListener
}
To promote the game:
- ๐ข Launch targeted advertising in Facebook Ads or Google Ads.
- ๐ค Collaborate with bloggers (send them promotional codes for premium content).
- ๐ Publish the gameplay on YouTube i TikTok with hashtags
#indiegame,#mobilegaming. - ๐ Optimize ASO (title, description, keywords) for better visibility in Google Play.
The most profitable model for shooters is a combination of advertising and in-app purchases (for example, selling weapon skins + rewarded advertising for bonuses).
FAQ: Frequently asked questions about creating a shooter on Android in Unity
How to reduce the size of APK/AAB?
Use the following methods:
- Disable unnecessary platforms in
Build Settings. - Install
Compression Methodon LZ4 or LZ4HC. - Delete unused assets (check through
Window โ Asset Usage). - Use
Addressablesto download content on demand.
What free assets can be used for a shooter?
In Unity Asset Store free packages are available:
- Kenneyโs Space Shooter Kit (ship, weapons, effects).
- Low Poly Simple Nature Pack (environment for a tactical shooter).
- Free SFX Pack (sounds of shots, explosions).
- Joystick Pack (controls for mobile games).
Also check itch.io i OpenGameArt.
How to make multiplayer in a shooter?
For simple multiplayer, use:
- Unity Netcode for GameObjects (NGO) โthe official solution for online games.
- Photon Unity Networking (PUN) โfree for up to 20 concurrent players.
- Mirror Networking โopen alternative UNET.
Connection example Photon:
- Import Photon Unity Networking from Asset Store.
- Register at Photon Engine and get
App ID. - Set up the connection in the script:
PhotonNetwork.ConnectUsingSettings();
PhotonNetwork.JoinRandomRoom();
Why does the game slow down on some devices?
Possible causes and solutions:
| Cause | Solution |
|---|---|
| Too many objects in the scene | Use Object Pooling and reduce the number of active ones objects |
| Heavy shaders or textures | Switch to Mobileshaders and compress textures |
Frequent calls Instantiate/Destroy |
Replace with Object Pooling or disable unnecessary objects |
Complex physics (a lot Rigidbody) |
Simplify colliders or use Kinematic Rigidbody |
How to protect the game from cheating?
Basic protection methods:
- Store critical data (points, health) on the server, not locally.
- Use Unityโs Anti-Cheat Toolkit (free in Asset Store).
- Encrypt your saves using
PlayerPrefsXor AES. - Check the playerโs movement speed (unrealistically high values may indicate cheats).
For online games, be sure to use server-side validation of actions.