Array index is out of bounds (size 2) error

I’m creating a WebGL application, using the latest Convai SDK on Unity 2022.3.59f1. I’m using avatars downloaded with ReadyPlayerMe. When building and running the WebGL application, I keep on getting Array index is out of bounds (size = 2) errors showing in the development console of the created experience. This does not show up when running in Unity (although it doesn’t work as per the WebGL SDK). Any ideas as to what is causing this?

Hello @p20266677,

Welcome to the Convai Developer Forum!

This issue is related to LipSync. The required blendshapes are not being found. Please ensure that the Convai LipSync component is configured to match the blendshape set supported by your ReadyPlayerMe avatar, whether it’s OVR or ARKit.

Once correctly mapped, the error should no longer appear in your WebGL build.

Thank you for the quick response!

Do you have any documentation or tutorials on how to get this done?

You should choose ARKit, not OVR.

I think I found the error, and hope this would help others. It seems as if the RPM downloader does not download the required blendshapes automatically. So one needs to use the RPM download link (https://models.readyplayer.me/xxxxxxxxxxxxx7.glb) with ?morphTargets=ARKit,Oculus Visemes

The latest version of RPM doesn’t automatically download the blendshapes. You’ll need to use version 7.3.0 instead. Please follow our documentation for the correct setup.

Yes, this is the guideline that I used. I tried following it with RPM 7.3.0 instead of RPM 7.4.0, however, the out-of-bounds error still pops up when built to WebGL. I am also unable to use the “Add components” option, as the popup does not allow the selection of Lip sync, and other options doesn’t add any components to the RPM character. At this stage, I’m thinking of rather using another avatar creator. Do you have any suggestions?

Click the ‘Add Component’ button, add the Convai Lipsync Component, and make sure to use the Renderer_Head object in the Head Skinned Mesh Renderer field, you can ignore the other fields.

This is part of the problem mentioned in my previous post, I cannot add Lip Sync using the Add Components function on ConvaiNPC. It shows the pop-up, but I cannot click Lip Sync. So I have to add it manually. This happens with both RPM 7.3.0 and 7.4.0.

I’m not saying to use ‘Add Components’, I’m saying to use the ‘Add Component’ button in the Inspector.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.