Multiplayer AR game sample
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Place Invaders

Multiplayer Place Invaders using Placenote Unity SDK with ARkit and Photon

Placenote SDK: 1.5.1

Project's Unity Version: 2018.1.1f1

Xcode: 9.3

Devices tested OS: 11.3

Steps to Deploy on 2 devices:

Before compiling to device:
  1. Register for a Free Photon Multiplayer Account and place your account's "AppId" into the "PhotonServerSettings" in the editor.

photon appid

  1. Register for a free Placenote account and get your api key here: To Add your Placenote API key, find the ARCameraManager object in the Scene hierarchy and add your API key under the LibPlacenote component in the Inspector Panel.

  2. Build the Unity project by Switching Platform to iOS in the Build Settings and click build to generate the XCode project. To build and run the XCode, follow the instructions on this page:

Playing the Game:
  1. Open Place Invaders on both phones.

  2. Player 1 must press the Host Game button.


  1. Then Player 1 must enter a room name and press the arrow to create the room.


  1. Player 2 must press the Join Game button. They will then be able to join Player 1's room once it is created.


  1. Player 1 will now be in the game and they must scan the play area - moving side to side. When finished scanning, Player 1 will press the "Finish Mapping" button to complete the scan and save the map's data.


  1. Now both players must look at the same scanned area to synch location and position. Then Player 1 can press the start button.


- Player 1 and Player 2 can join or leave at anytime. They just need to localize before they can play.

Used technologies:


Placenote (creating AR maps):

Photon (for Multiplayer):

Space Invader Models and Animations:

Important Scripts:

Project Setup: This project's workflow is split into three different sections: Main Menu, Placenote Multiplayer Manager, and Gameplay Session. This project is designed so that you can easily take the Placenote Multiplayer Manager section, apply that to your own game, and turn it into a multiplayer AR masterpiece!

Main Menu Section

This section is all of the menus before a player joins or hosts a game. It does not have any super important scripts. It is mostly just Unity UI navigation. Note that the UI is controlled by Unity's built in UI system.

Placenote Multiplayer Manager Section

PlacenoteMultiplayerManager.cs: this is the most important class in the project. It is the master class that controls all of the Placenote mapping and Photon Multiplayer integration you will need. It has functionality to handle Photon connection, room setup, room joining, and room leaving. It also handles Placenote mapping, map saving, map loading, and localization. It contains subscribable events designed to interface with the rest of the project. This class is mostly called on OnClick button events and MappingText.cs.

PlacenotePunMultiplayerBehaviour.cs: an extendable class that provides all callbacks that PlacenoteMultiplayerManager can call. Most UI scripts extend this class to get updates on Placenote and Photon changes.

MappingText.cs: controls the user feedback for a Placenote mapping session. Uses most of the callbacks from PlacenotePunMultiplayerBehaviour.

Gameplay Session Section

GameController.cs: controls game logic including starting game, creating enemies, and managing players (creating new, registering, removing).

GameData.cs: stores game data about enemies and players. Also creates events about changes in game data and game state for UI components to update.

PlayerPhotonGenerator.cs: controls spawning of players.

PlayerController.cs: controls player lives, damaging enemies, and synchronizing with Photon.

WeaponController.cs: shoots enemies and calls missing or hit actions on AnimatedGun script.

AnimatedGun.cs: creates shot that damages enemies. Also controls shooting animation, time between shots, and synchronization shots with Photon.

EnemyAI.cs: controls enemies behaviour (attacking players, moving), and contains enemy properties( AttackPower, AttackTimeLimit, Speed etc.).

EnemyState.cs: contains enemies health, player shot interaction, and enemy death.

RespawnPoint.cs: controls spawn rate of enemy spawning.