Let's talk about avatars!!
Avatars are mostly used to visualize characters in a 3D game/experience. Generally, having uncanny avatars in your game can make the users uncomfortable. Now that the metaverse is gaining popularity, avatars are becoming more significant. And, having bad avatars can ruin any VR experience as well.
Having looked at various avatar creating platforms like Spatial, avatarsdk, IMVU etc. One that stood out was Ready Player Me. The best part about this is you can not only create avatars, but you can also download the models and animation and use it in your project. So, this blog will be focusing on creating your own avatar using Ready Player Me and integrating it into Unity. Later we’ll tell how you can easily add rig your avatar using Animation Rigging and IK.
It's really simple to create an avatar in Ready Player Me.
Wasn't that really simple? Importing that into Unity is also as simple as that! So let's see how it's done.
To import the avatar into Unity you need to download the Unity Avatar SDK provided by Ready Player Me. To download it:
Once you have the SDK downloaded, create a new Unity project or open an existing one and let’s see how we can get the Avatar into Unity.
Note: Make sure you are using Unity version 2019LTS and above
That was simple, right? Now that we have an Avatar with us, we can use the XR Interaction Toolkit and Animation Rigging packages to add VR components and inverse kinematics to the Avatar. Inverse kinematics is nothing but adding movement to other parts by moving one of the connected parts. Thus, enabling us to use the avatar in VR.
In this section, we will see how we can set up Unity for VR and convert this regular avatar into an avatar that can be used in the metaverse! We will be making use of the XR Interaction Toolkit and the XROrigin Unity package that's custom made by us.
Note: If you already know how to set up your project for VR or if you already have your own XROrigin, then please feel free to jump to the next section.
In this section, we’ll set up the avatar and use the Animation Rigging package to add inverse kinematics to it to have a realistic body movement in VR.
That completes setting up the Avatar with an animation rig. Next, was want the Avatar’s head and hands to follow the XROrigin’s camera and the hands respectively. So, let's move on to the next section.
Let's write a script that will allow us to move the avatar along with the XROrigin. The script will not work directly, we need to make a few adjustments to the avatar’s transform later in the Unity editor so that it matches the XROrigin.
With that, we have successfully rigged our Avatar for VR.
In this blog post, we've learned how to create an avatar, import it to Unity and rig our Ready Player Me avatar for VR.
So, what to do next? Well, we rigged only the upper body but you can go further and rig the lower body as well (Maybe something that we will cover in the next blog post). Also, the hands can be animated when the grip and trigger buttons are pressed.
See you next time!
If you've enjoyed the insights shared here, why not spread the word? Share the post with your friends and colleagues who might also find it valuable.
Your support means the world to us and helps us create more content you'll love.