How to replicate animations on models that aren't directly part of Player.Character but are network owned

I have a pet that follows the player and interacts with the environment.

  1. The pet is a model created on the server side
  2. The owner player is given network ownership of the pet
  3. The owner’s localscript controls the pet’s movement and animations

I’m facing the issue that the animations aren’t replicating to other clients. Your pet moves fine on your screen but another player will see it T-posing.

Replication is solved if you parent the pet to the player’s character, but that’s a very hacky method which interferes with grouping models.

I looked into documentations for the Animator object:

Loading an Animation on Client or Server

In order for AnimationTracks to replicate correctly, it’s important to know when they should be loaded on the client or on the server:

  • If an Animator is a descendant of a Humanoid or AnimationController in a player’s Player.Character, animations started on that player’s client will be replicated to the server and other clients.

  • If the Animator is not a descendant of a player character, its animations must be loaded and started on the server to replicate.

I want to avoid manually working on a replication system since it also interacts with StreamingEnabled edge cases which makes this 10x harder than it needs to be (ex: you need to track a model that’s been loaded in which already has idle playing at time position X). These interactions are already solved by the Roblox implementation.

Can I somehow get the replication to work without a manual system?

2 Likes

Are the pet animations played on the server as well? Each AnimationTrack should be a variable that is created and played through a server-sided script.
There are two ways you could go about doing this: You could fire a remote event to the server and directly play the animations there, or you could fire the server and then fire all clients to play the animations, excluding the initial client (though this may be more of a manual approach)

No, these pet animations are played on the clientside first. I wanted smooth and clean movement on the player’s pet. In fact, the pet should be treated as an extension of the player, almost like a second character.

This isn’t possible since it would take time for the animation to replicate back to the owner.

It looks like there’s no way to cheese the system. Manual replication seems to be the only way. I like your current suggestion. I’ll mark is as the solution.

The hardest thing now is to solve the edge cases for StreamingEnabled since pets not owned by you load in and out, which can happen mid-animations.