For a side-project I am working on, I need to be able to selectively decide if I would like Character animations to filter or not. In other words, I would like all of the default animations conducted by a Character’s Animate script to replicate as usual, but I would like some custom animations I am playing to not replicate.
The main reason I need this sort of behavior is due to the complexity of the animations’ implementation. The animations have Markers that, when triggered, create/modify/destroy Parts–all changes that are not replicated. Therefore, I need each client to play the animation on their own. However, since the Character’s client is also playing the animation, and it is replicated automatically, all other clients see the animation start and then restart (i.e. they see the animation played twice).
Many topics have been made that have similar problems, but the solutions given are less-than-desirable (for my situation):
- One solution was to simply not play the animations on the other clients. Obviously, this won’t work in my case.
- Another solution was to re-create the Character’s Animator object, which completely disables replication. Were I to go with this, I would have to override the default Animate script with a modified implementation that instructs the server to replicate avatar animations–another not-desirable solution, as this will prevent any Roblox updates to the Animate script from being applied to my game (and it introduces some problems with loading a Character’s avatar animations).
- An additional solution was to play the animations on the server. This would introduce noticeable latency between the client triggering the animation and the client seeing the animation (i.e. poor user experience).
The ideal solution would be a boolean property of AnimationTrack that toggles automatic replication (e.g.
AnimationTrack.AutomaticReplicationEnabled = false). However, this obviously does not exist. Does anyone know of a clean solution to this problem?