How to (actually) work with Avatars in Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in the previous video we talked about how you can use the new Ready Player me API on the service level we had a quick overview so how do you get your avatar how do you get the 3D one the 2D ones some metadata how we can change some parameters inside of the URL but now I want to dive a little bit deeper and show you how you can use the Avatar configuration file as a scriptable object instead of unity to do some really cool things especially during runtime let's dive into Unity right away so here we are in unity basically just a simple naked Unity project nothing fancy here I have the version 2021 3.13 that's the current LDS version and now what you want to do is you want to get the Ready Player me SDK first so therefore let's check out the Ready Player me documentation and in here we can scroll all the way down to Unity SDK if you use unreal that is available here as well and now we see a download over here here so you need the 2019 LTS or later you can go and click download or not the latest version and yeah just import it into unity and there we are freshly imported Ready Player me SDK so let's check it out we actually have the where to play me window over here already settings on where you actually find the Avatar configuration file so very conveniently we just have it right here so we can just click you don't have to remember it which is pretty nice assets plug-in Ready Player me resources data and then the Avatar configuration and here is where we have our scriptable object if you don't know what a scriptural object is then definitely check out this video here I really love using them and they are extremely extremely good for riding a stable in robust code so definitely check out this video if you have never heard of this term so let's see what do we have here we have similar settings like we had in the previous video already but now we can dynamically change them we have the mesh LOD so we have the high medium low and over here we also have the apost and t-pos we have the texture Atlas and that's an example that I will show later on as well we can set this here so we can also just um not use them so then we have like nine or like depending on how many draw calls you want to have you have like nine to ten textures and then also draw calls but you can also just have one and here you can change the size of how big they are if you have a half body Avatar you can use hands as well and then we have some more of targets that we can Define here as well again these are the things that for like changing the mesh of your mouth and like your face basically one thing that is really cool is that you are super flexible in actually creating these so you can basically just for example um duplicate this one you have some presets high medium low of course but then you can have maybe like your special one special there we go and then you have some specific settings like maybe like a t-pose for this one but you only want to have like the um High um texture Atlas and then you want to have the use hands or whatever you want to do here you can also create this in runtime so that is something that is really just um viable to you as well whatever you want to do one thing that is also really nice to know or pretty important to know I would say is how do we actually set some of these so that's where you go to the settings over here and that is your global standard so whenever you are using the Avatar loader you will basically get this scriptable object over here if you have none selected for whatever reason then you would get the default one that is linked in the back end but again I would just highly recommend to use any of these so you can just drag them in here which is pretty convenient and let me actually show you an action how that might look like so let's close it and now we go to assets yeah plugins Ready Player me and then we have some examples that we can check out so runtime example and over here so nothing fancy right now but we have this object over here with the script runtime example and here of course you want to have our own avatar and not this default one so again we can go to the radial Premiere Hub my avatars and then in here we can get the copy URL and now we can just paste it in here and there we go so now we can hit play and let it load and then three two one okay that was faster than expected so now we see we have our Avatar loaded and I think this should be the low settings the low configuration exactly so now let me actually just um go to the scene view we can um just click here hit F and now we see our Avatar in action yeah nothing too fancy we see um everything that we have specified but let's now change some of these settings and see the difference so let's actually check out how we can create our own and now I'll just change some settings and then see how it reflects and I think it makes a lot of sense to just show you how it looks if you don't have any Atlas so now let's just um check it again and see how it looks if we have the atlas setting on so we everything is together we're not Avatar so if I turn this off the hammer that disappears and it's just like one kind of um object one mesh and now let's uh build another scriptable object so where was it again I don't remember so I will just go over here again and now we can just create one let's just call this one test for now and now in here let's um yeah just do no texture at least so you kind of see what I was talking about and of course um enable this one or activate it over here and now runtime example yeah that should stay the same so let's hit play and no yeah we should look exactly the same there we go we have our Avatar but if we open it now we see okay we have a bunch of different materials and meshes and yeah from the outside looks exactly the same but again these are now I don't know like 10 elements or so which is a lot more than just having one the last thing that I would like to show you is how you can do that same stuff in code so how you can you replace the global Avatar config with your own that you can create in runtime so therefore let's actually just check out the example here here we are in visual studio and yeah that's the runtime example and basically what you need to do is you need to know in here for example create your own scriptable object so first of all let's actually check out the Avatar loader that is part of the SDK that we have you find it under the runtime and then over here basically and here in this file you will basically see the Avatar config so scriptable object Avatar API and you see it's publicly exposed so you can actually just create it let's actually create one of these so there we go and now we can basically go in here and um can also serialize it if he wants to and then Avatar config and then a our own basically let's just call it this way so there we go and then in your start method you want to create your scriptable object so so where is it about a config equals no not the big one the small one uh this one equals and then create and then yeah I think that first of all it's the object Dot and then create instance of the type ever the conflict have a config there we go and now basically lock this go outside and there we go and now we can basically use all of these settings that we had initially as well so we go over the config Dot and now we can change the meshadow D the morph targets and all of the other things so for example over here that is probably the enum so mesh load Dot and then high medium low let's just say low for example and then the last thing that you want to do is you want to replace the global one with this one and have a probably like this Dot and no it's actually ever to loader exactly Dot uh not the big one the small one dot and now the config so this is the global one equals and now you want to replace it with yours so this here and now that way you could actually in runtime when something happens when you press a button and you want to do that fancy stuff over here you can create it you can Define it here then you create the instance you can do some of the settings that you we had initially as well again they're like all the others as well dot and they are of course also exposed over here you can change the post for example equals for probably post Dot and then a post t-post do all of these settings here and that's how you would do it as well all right and that's it already so we learned about how to use these scriptable objects to change the parameters in unity or directly in code so you can have a more Dynamic experience for your players for your own game whatever you want to do and yeah let me know if you have any questions please and if the video was helpful please leave a like I really enjoy doing this and again thanks so much for already playing me for sponsoring this video super super cool to work with you and as always I see you in the next one
Info
Channel: Dinesh Punni
Views: 7,845
Rating: undefined out of 5
Keywords: ready player me unity sdk, ready player me unity, ready player me unity package, ready player me, ready player me avatar creator, ready player me blender, ready player me quest 2, ready player me sdk, ready player me to vrchat, unity ready player me, ready player one, unity avatar sdk, dinesh, dinesh punni, metaverse, metaverse avatar creator, metaverse cross platform avatars, metaverse explained, readyplayerme, avatar api, ready player me avatar api, avatar sdk, rpm avatar api
Id: N0s2mgxbXNU
Channel Id: undefined
Length: 10min 11sec (611 seconds)
Published: Wed Nov 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.