dontworry
dontworry8mo ago

Custom avatar's animated hands not syncing to the network

I have a custom prefab linked as the Local Avatar Prefab on the Realtime Avatar Manager on Realtime + VR Player. In the scene I have a script using AvatarCreated() to SetActive(true/false) different nested objects in the avatar prefab so player 1 vs player 2 have different hand objects under the Left Hand and Right Hand hierarchy. Another script is on the Left Hand and Right Hand objects directly, which takes the controller's trigger value to blend an animation on the nested objects into clenching a fist. I used _realtimeView.isOwnedLocallyInHierarchy so the trigger only affects the local avatar, and I applied GetComponent<RealtimeTransform>().RequestOwnership(); on every nested object, putting RealtimeTransform components on every level to network the rotating objects in this animation. The clenching fist animates locally, but the other player does not see the animation. Any idea what I'm doing wrong here? Thanks
5 Replies
kapa.ai
kapa.ai8mo ago
Hi @dontworry. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information you've provided, it seems like you've done a good job setting up your avatar and animations. However, there are a few things you might want to check: 1. RealtimeTransform Component: You mentioned that you've added a RealtimeTransform component to every nested object. This is a good step as RealtimeTransform is used to synchronize the position and rotation of game objects across the network. However, you need to ensure that the RealtimeTransform component is correctly set up. For instance, if you're using a rigidbody with RealtimeTransform, you should set it to "Maintain Ownership While Sleeping" to retain ownership of the Player RealtimeTransform at all times (source (https://normcore.io/documentation/guides/creating-a-player-controller#making-it-multiplayer)). 2. Ownership Request: You've mentioned that you're using GetComponent<RealtimeTransform>().RequestOwnership(); on every nested object. This is used to signal that all other clients should use this client's transform as the source of truth. However, you need to ensure that this is being called when the prefab is instantiated (source (https://normcore.io/documentation/guides/creating-a-player-controller#making-it-multiplayer)). 3. Animation Synchronization: If the animations are not being seen by other players, it might be because the animations themselves are not being synchronized. Normcore provides a way to synchronize custom data, which might be useful in your case. You can check out their guide on Synchronizing Custom Data (https://normcore.io/documentation/realtime/synchronizing-custom-data) for more information. 4. RealtimeAvatar Component: Ensure that your avatar prefab includes a RealtimeAvatar component on the root. This component is responsible for synchronizing the head and hands positions and active states (source (https://normcore.io/documentation/realtime/xr/avatars#realtimeavatar)). If you've checked all of these and the issue persists, it might be a good idea to reach out to the Normcore support for more specific guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai8mo ago
<@666359106176679966> kapa.ai is still learning and improving, please let us know how it did by reacting below
dontworry
dontworryOP8mo ago
@Normcore Assistant For Animation Synchronization, if a game object nested in the avatar prefab has an animator component that rotates other nested objects with realtime transform components, do those object rotations not get networked automatically? Or do I need to create a custom model to synchronize the animator's state?
maxweisel
maxweisel8mo ago
@Tom any idea why this didn’t trigger the bot?
dontworry
dontworryOP8mo ago
I wired up a custom model to network all 4 triggers for 2 players, then had those blend the animations so it's all synced now, thanks. I was hoping since the animation is just a rotation of some nested objects i could slap a realtime transform on them and it would network them as part of the avatar, but maybe animator components don't work like that?