
Learn to build a fully working multiplayer augmented reality game from scratch using Unity, Photon Unity Networking 2, and AR Foundation, with surface detection, movement synchronization, and respawn mechanics.
Explore Photon as a Unity multiplayer engine for AR games, compare host client and dedicated server models, and review cross-platform features, latency, and development-stage pricing.
Discover how AR Foundation enables cross-platform AR with ARCore and ARKit in Unity, simplifying development and core functionality, with official resources and sample projects to start building.
Create the project by selecting a Unity version (2019.3 beta or 2019.2+ for AR Foundation), using Unity Hub to install versions and target iOS or Android, naming SpinnerTop-MultiplayerAR-Game.
Import a Unity package of assets for the multiplayer AR game, including UI elements, 3D models, textures, and ready-to-use scenes to accelerate building AR battles.
Explore the Unity physics engine to implement player movement in a multiplayer AR game. Learn to use physics materials like ice and spinner to control friction, gravity, and bounciness.
Develop a movement controller script in unity to move the player with a joystick, using horizontal and vertical inputs to form a normalized velocity for AR gameplay.
Learn to finish the movement controller by driving the player with a joystick, using a rigidbody and fixed update, applying velocity changes with AddForce and clamping for controlled speed.
Apply the MovementController script to all player prefabs and tilt the spinner top toward the movement direction using the joystick’s vertical and horizontal inputs, with adjustable tilt amount and speed.
Create a Unity spinner script to spin the spinner top using spinSpeed and doSpin, rotating the playerGraphics transform in FixedUpdate, and apply it to multiple models for trail effects.
Add trail effects to spinner tops in Unity using Trail Renderer, adjust width, time, curve, color, and materials to create dynamic, colorful spinner visuals and prepare for multiplayer setup.
Import Photon Unity Networking 2, create a Photon cloud app, and configure regions and app version for multiplayer augmented reality games.
Connect to Photon servers with a player name using a lobby manager in Unity, then set the nickname and load the player selection scene with login and lobby UI.
Activate login, connection status, and lobby UI as you enter the game and connect to Photon servers. Track connection state with PhotonNetwork.NetworkClientState and OnConnectedToMaster, and update the connectionStatusText.
Implement a cross-scene loading flow in Unity using a singleton SceneLoader that persists across scenes, showing a loading scene during transitions and integrating with Build Settings.
Use a singleton SceneLoader to load scenes efficiently in Unity by asynchronously loading a loading scene first, then the target scene, using coroutines and 90% progress gating with SceneManager.LoadSceneAsync.
Explore how the PlayerSelectionManager lets players switch between four spinner models in the user interface, rotating the playerSwitcher with a 90-degree, 1-second coroutine while disabling controls during the turn.
Learn how to implement custom player properties in Photon for a Unity AR game, using a playerSelectionNumber, spinner models, and hashtables to reliably sync selected player across scenes.
Finish the player selection system by showing attacker and defender model types, enabling select and reselect, and loading the gameplay scene via the scene loader.
Join random photon rooms in a Unity multiplayer AR game, handle failures by creating a room with a random name and max players, and track joins with OnJoinedRoom and OnPlayerEnteredRoom.
This lecture builds a matchmaking UI in Unity using Photon, updating players with a UI Inform panel during join or create room, handling OnJoinedRoom and OnPlayerEnteredRoom, and auto-hiding the panel.
Spawn players in a multiplayer AR game with a spawn manager that instantiates player prefabs based on selection, using Photon callbacks and custom properties at random spawn positions.
Learn how to set up players for local control in a multiplayer Unity game using a PlayerSetup script, PhotonView.isMine, and enable/disable MovementController and Joystick for local versus remote players.
Display player names above avatars in a multiplayer Unity augmented reality game by binding TextMeshPro text to photonView.Owner.NickName; show you in red for the local player, remote names otherwise.
Master photon view synchronization for multiplayer AR with photon transform view and photon rigidbody view, observing components and implementing IPunObservable to sync position, rotation, and velocity.
Create a custom synchronization script using IPunObservable to observe and sync a player's position and rotation via PhotonStream, handling local vs remote ownership in Awake and FixedUpdate.
Implement lag compensation in a Unity multiplayer setup by enhancing MySynchronizationScript to synchronize velocity, angular velocity, and teleportation. Use PhotonNetwork.Time and ping to adjust networked positions for smoother gameplay.
Optimize your multiplayer AR game for mobile by adjusting lighting, quality, and rendering settings, then build and run on Android and iOS devices using ARCore and ARKit configurations.
Develop a battle script in Unity to drive SpinnerTop combat, using spinSpeed as health and a UI bar to display it, and use OnCollisionEnter to compare speeds and apply damage.
Apply damage to the slower spinnerTop on collision, synchronize health via photon RPCs, and update the spinSpeed UI and ratio text for a multiplayer Unity AR game.
Implement attacker and defender damage coefficients in a Unity AR game to balance battles by tying default damage to velocity, spin speed, and type-specific multipliers.
Implement a multiplayer respawn system in Unity using Photon: show a death panel with an 8-second countdown, disable movement and spin, and respawn across all clients via ReBorn RPC.
Implement a quit match by leaving the Photon room to return to the lobby, and balance battles by capping excessive attacker damage to 400 for fairness.
Explore how to integrate augmented reality into a multiplayer game using Unity, including plane detection, placing and scaling a battle arena, and joining or creating multiplayer rooms.
Install AR Foundation with ARCore and ARKit plugins in Unity to build cross-platform AR scenes, then create a simple AR Foundation scene using AR Session and AR Session Origin.
Implement plane detection with AR Plane Manager in the AR Foundation scene to detect flat surfaces and anchor the multiplayer battle arena, using trackable managers.
Learn to configure Unity AR Foundation for ARCore on Android, set build settings, and run an AR scene that detects flat surfaces using ARCore on Android devices.
Configure Unity's AR Foundation to use ARKit for iOS, set the iOS build settings, and build, sign, and run on an iPhone to detect flat surfaces.
Implement AR foundation in the gameplay scene by adding AR session, AR session origin with AR camera, and AR plane manager to place the battle arena in AR.
Place the battle arena in the multiplayer augmented reality game by raycasting from the screen center to detected planes, using AR Foundation's ARRaycastManager to position the arena on flat surfaces.
Control ar placement and ar plane detection to place and reposition the battle arena. Toggle ar plane manager and ar placement manager, and update user interface prompts and buttons.
Scale AR objects safely by adjusting the AR Session Origin with a UI slider, preserving physics and plane detection, while learning placement deactivation during scaling.
Explore the biggest position synchronization issues in multiplayer AR, including arena placement differences and remote spawning, and learn how to adjust spawn manager and synchronization logic for consistent gameplay.
Implement manual player instantiation in multiplayer AR games using photon raise events to share spawn data. Ensure spawn positions derive from the battle arena position so remote players instantiate correctly.
Receive events via the OnEvent callbacks and instantiate remote players using the received position, rotation, photonViewID, and player selection data, ensuring correct battle arena placement across clients.
Learn to synchronize movement data in multiplayer AR games using Photon OnPhotonSerializeView, transmitting position, rotation, and velocity with a battle arena offset to keep AR gameplay consistent.
Add collision sound and visual effects by instantiating a visual effect prefab on collision enter. Use object pooling to activate effects and deactivate after 0.5 seconds.
Multiplayer Augmented Reality Games are becoming popular with the latest improvement in AR tech. We have now very stable ARCore and ARKit SDKs to build immersive AR experiences. Also, with Magic Leap and Microsoft HoloLens, AR experiences reach to another level.
So, a new gaming experience has arrived! It is Multiplayer AR Games.
There are already very successful Multiplayer Games out there such as Pokemon GO, Harry Potter: Wizards Unite and Mini Guns - Omega Wars...
If you are a game developer, there can't be a better time to develop and publish a Multiplayer AR Game to the stores...Because there are really a few games and the potential is huge! That's why I created this unique online course on Multiplayer Augmented Reality to help game developers publish their own Multiplayer AR Games.
In this course, you will learn the basics of Multiplayer Augmented Reality game development.
Once we completed the single-player mode, we will implement Multiplayer using Photon Unity Networking 2 package as the multiplayer engine.
For the Multiplayer side of the game, you will learn:
Connecting to Photon servers
Joining random rooms
Player Selection
Manual Player Spawning
Writing your own Synchronization script to synch player movement.
Killing and respawning mechanism
Then, we will implement Augmented Reality into the multiplayer game we've built. We will use the top AR SDKs which are Google's ARCore and Apple's ARKit. And with Unity's AR Foundation, we will develop only once and deploy the game to both Android and IOS devices. That will definitely save you some development time...
For the Augmented Reality side of the game, you will learn:
Implementing AR to a Unity Scene
Implementing ARCore/ ARKit to the Project with AR Foundation
Detecting Flat Surfaces and Visualizing AR Planes
Placing the Game Arena to Flat Surfaces
Scaling in Augmented Reality
Movement Synchronization in Augmented Reality
Support for Unity 2019.3!
Come and join me if you want to be part of this new, awesome Gaming platform which is Multiplayer Augmented Reality.
Let's build together!
-Tevfik