Coder Social home page Coder Social logo

metaperson-unity-photon-sample's Introduction

MetaPerson - Photon Multiplayer Sample

This sample demonstrates how to use MetaPerson avatars in unity multiplayer applications using Photon package.

Photon Sample

Requirements

Getting Started

  1. Clone this repository to your computer
  2. Open the project in Unity 2021.3.19f1 or newer.
  3. Import Photon PUN 2 Free or Photon PUN 2+ package and configure App PUN settings.
  4. Add the following scenes into Build Settings and build a Windows, Mac, Linux app.
  • Assets/AvatarSDK/MetaPerson/PhotonSample/Scenes/LauncherScene.unity
  • Assets/AvatarSDK/MetaPerson/PhotonSample/Scenes/GameScene.unity
  1. Run the built app as the first instance, enter user name, select an avatar and press Play button.
  2. Run the Assets/AvatarSDK/MetaPerson/PhotonSample/Scenes/LauncherScene.unity scene in Unity, enter user name, select an avatar and press Play button. It is the second instance.

How It Works

LauncherScene

This scene represents a Lobby. Here you enter your user name and select an avatar.

  • User name is stored in the PlayerPrefs.
  • There are the sample avatars that are loaded by the link to a GLB file.
  • When you click on a Play button, the link to the selected avatar is stored in custom properties (PhotonNetwork.SetPlayerCustomProperties) and is used by PlayerManager in GameScene.

GameScene

It is a room where avatars of the connected users are shown. Once a new user enters the room, its avatar is being loaded from the provided link. The MetaPerson Loader package is used to load an avatar in GLB format at runtime.

MetaPersonPhotonPrefab

It is a prefab that is instantiated for each player. This prefab is configured for template avatar model that is stored in assets. Initially the template model is shown for each player. Once the avatar model from the passed link is loaded, it replaces the template model.

Integration MetaPerson Creator Into App

The AvatarSelectionScene scene demonstrates how to integrate the MetaPerson Creator web page into your application for creating new avatars or customizing already created. You can scroll through the sample avatars, find a slot with the custom avatar and click on the Create My Avatar button.

The communications between MetaPerson Creator and Unity are performed via JS API.

Create Avatar

AvatarSelectionScene Configuration

  1. Import Vuplex plugin for Windows and macOS into the project. This plugin is required to show MetaPerson Creator web page inside a unity application. We can provide you with a 20% discount coupon for this plugin. Please contact us [email protected] to get it.
  2. Find the SceneHandler object and provide your Account Credentials. Account Credentials
  3. Add Assets/AvatarSDK/MetaPerson/PhotonSample/Scenes/AvatarSelectionScene.unity into Build Settings.

Support

If you have any questions or issues with the sample, please contact us [email protected].

metaperson-unity-photon-sample's People

Contributors

dledents avatar

Stargazers

Reiya avatar

Watchers

Alexander Shishkov avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.