Custom Avatar

In this tutorial we are going to showcase how to use your own custom Avatars in MAGES SDK.

Custom Avatar setup

For this tutorial we are going to create two avatar options, a cube and a sphere.

  1. Create an empty game object. In our example we will name it CustomAvatar

../../../_images/create_customavatar.png
  1. Create another empty object as a child of CustomAvatar which will be used for the offset. In our example we will name it CustomAvatarOffset.

../../../_images/create_customavataroffset.png
  1. Create the cube as a child of CustomAvatarOffset. In our example we will name it as CustomAvatarCube.

../../../_images/create_customavatarmalecube.png
  1. Create the sphere as a child of CustomAvatarOffset. In our example we will name it as CustomAvatarSphere.

../../../_images/create_customavatarfemalesphere.png
  1. Scale both the cube and sphere to 0.3 for xyz axis.

Note

Reason for doing this is because if they are too big their colliders will also be too big and you wont be able to move your hands in XR. You could simply turn off your collider or make it smaller so that it wont collide with your hands, this is just the approach that was chosen for this tutorial.

  1. To be able to use it for coop, turn it into a prefab by dragging it into Assets/Resources.

../../../_images/save_prefab.png
  1. Navigate to MAGES > MAGES Panel > Advanced Settings and set your new CustomAvatar to the Avatar Prefab in the Interaction System Module.

../../../_images/set_customavatar.png
  1. Your Custom avatar is ready.

Character Selection UI Menu Change

You can also change the character selection Menu, with two steps.

  1. Simply search for the CharacterCustomizationCanvasMedical prefab and replace the old pngs with your own. We replaced them with Cube and Sphere.

../../../_images/replace_old_pngs.png
  1. Do the same but this time replace the source image for every image with your own.

../../../_images/change_in_images.png

Custom Avatar in-game

Lets see your custom Avatar in game.

Important

Its important to keep in mind that the Avatars are visible only when using multiplayer.

  1. Start the game and click on Edit Avatar.

../../../_images/click_edit_avatar.png
  1. Player A will pick Cube.

../../../_images/pick_male.png
  1. Player B will pick Sphere.

../../../_images/pick_female.png
  1. Player A will host the Session and Player B will join.

  2. Now Player A can see Player B as a sphere (CustomAvatarSphere) and Player B can see Player A as a cube (CustomAvatarCube).

Player A POV:

../../../_images/playera_pov.png

Player B POV:

../../../_images/playerb_pov.png

Note

Player A is using Mobile3D and Player B is using XR.