We are using Unity, Photon and RPM. I am working on “RPM Photon Support 0.3.1 Avatar Control” scene.
I changed our Avatar Config according to this video: Eye Animation Handler helps you make avatars look more alive #shorts - YouTube
LightShot (prnt.sc)
And I attached that config file to our RPM Photon Character prefab.
I added “eye animation handler” component to the prefab, too.
But after the game loads the avatar, I get this error:
Also, “Eye Animation Handler” component gets disabled on RPM Photon Prefab Clone but I can’t post a screenshot because of “the topic new user limits”
Can someone help me?
Hello and welcome to the forum!
If the component gets disabled, it is probably because the model doesn’t have eyelid blend shapes.
Are you loading the characters at runtime? If so, you need to make sure that you are loading them with the config you made, which includes the morph targets. So you can reference the config on your character loader script and assign it on the inspector, then make sure to use the config on your loading method.
I am using the code from RPM Photon example. As I said on the first message, I assigned avatar config to the RPM Photon Character Prefab NetworkPlayer Component.
GameObject character = PhotonNetwork.Instantiate("RPM_Photon_Character", Vector3.zero, Quaternion.identity);
character.GetComponent<NetworkPlayer>().LoadAvatar("6617e00fce940500008d6e54");
We have pushed a recent update to the package to ensure that the avatar config is set before loading the avatar.
Now I understand there is still an issue with the EyeAnimationHandler
component script throwing an error; we were able to reproduce it and track the issue. The team is currently working on a fix, and we will update the package soon. I will keep you posted in this thread as well.
YouTube
Thank you, I have just recorded a video for the bug after the 0.3.2 version.
Please remember to check voice animation handler, too.
It gives same kind of error, too.
any news about the new problem?
Hello,
It’s still being worked on and will be part of the next release but if you want a quick fix in the meantime, you can do these steps:
- Changes on
NetworkPlayer
script (Can be found under Packages\Ready Player Me Photon Support \Runtime)
Note: For this one, since it’s in the packages folder, it’s better to make a copy of the script in your assets/scripts folder. You can edit the script for test purposes but it will be overridden when you pull the next updates so if you want to make your custom script, make a copy.
Within the SetPlayer()
method, after the AvatarMeshHelper.TransferMesh(args.Avatar, gameObject);
line, add gameObject.AddComponent<EyeAnimationHandler>();
to add the Eye Animation Handler component via script after the avatar loading.
Now if you press play, eye blink should work!
Again, this is a quick fix. We will release a proper fix on the next package update.
Will this also work for voice animation handler? It has same kind of error, too
Yes, you can add the gameObject.AddComponent<EyeAnimationHandler>();
via script as well similar to the Eye Animation Handler component to make sure it’s also added after the character has been loaded
hi, any news about the update?
Hello,
This week, we released a new SDK version of the Ready Player Me Core SDK that contains the fix. Please update the package by going to Window → Package Manger → Ready Player Me Core and then click on Update.
You still need to do these steps manually:
-
Add the Eye Animation Handler Component to the RPM Photon Character Prefab that you can find in the Resources folder. (The same goes for the Voice Handler Component if you also want to animate the mouth).
-
Create your custom network player script; for instance, you can create a script called CustomNetworkPlayer under the Assets/script folder, copy the existing NetworkPlayer script and paste it into the newly created script. Then, after this line:
AvatarMeshHelper.TransferMesh(args.Avatar, gameObject);
Add the following lines:
if (gameObject.GetComponent<EyeAnimationHandler>())
{
gameObject.GetComponent<EyeAnimationHandler>().UpdateHeadMesh();
}
(The same goes for the Voice Handler Component if you also want to animate the mouth).
- Make sure to change the reference of NetworkPlayer to CustomNetworkPlayer (Within the Photon Setup script).