Syncing Xevious enemies with MLAPI

The basic synchronisation

Network Object Component

Transformation Synchronisation

Network Transform.
Basic Sync demo

Pooling Objects

Object Pooling
  1. The handler only fires on the Client. I admit this confused for me for a while.
  2. The RegisterSpawnHandler does NOT have any concept of type. Therefore when you RegisterSpawnHandler is invoked you have no idea what prefab it has been invoked for. Therefore writing a single delegate to handle all the calls for any pooled object type is not possible. MLAPI wants you to have a pool per object, rather than a pool that can manage multiple objects. Therefore in the above code I am using closures to create a delegate per pooled object type, the prefab name is captured locally before the above snippet.
Pooled Demo

Animations and Fly-ins

Network Animator Component
gameObject.SetActive(false);
gameObject.transform.position += Vector3.up * 100f;
Final Demo

Where next?

  • the enemy bullets — should these still be just sync’ed tranforms & animations?
  • basic ground targets. — ground targets must be a child of the scrolling background and must move using local rather than world position.

Unity, VR, Enterprise and .Net Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Read Multiple Sheets from Excel File and Load into Table using SSIS.

Enrich Chatbot Entities With Patterns, Roles & Groups Using Rasa

L&D series: Trying out simple API tests with Postman

Characterizing Software Developers by Perceptions of Productivity

Google Authentication with Postman

ChangeWindows 7

The ChainLog Database — A Curated List of Blockchain Projects

Building Multi-Region Active-Active Architecture in AWS using containerised microservices

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Paul Marsh

Paul Marsh

Unity, VR, Enterprise and .Net Developer

More from Medium

2D Mobile: Setting Up The Player

Script communication in unity using GetComponent:

Previsualization in Unity (Game Dev Day 52)

Galaxy Shooter —Basic Enemy AI