AnimationTrack:AdjustWeight() does not replicate?

I’m currently experimenting with the AdjustWeight() function of AnimationTracks in order to achieve a footplanting-esque feel as the player walks in 8 different directions.

I’ve gotten both the animations and code down already, and it works nice and smoothly, but I’m struggling with the weights not being replicated to the server.

Here’s what it looks like:
https://gyazo.com/c0a8041dac3c9afd64423af4197379e6

Animations are definitely being played on the client’s end, but the other players would just see a character trying to transcend time and space while idling.

I’m thinking of just resorting to having the server tell every client that a player is modifying their animations’ weights, but I want to know if this replication “issue” is supposed to be intended (which would be weird if that were the case, seeing as locally created animations could be replicated by the client anyway.)

EDIT 1: It seems this issue has been recurring for many prominent developers since '16. AnimationTrack:AdjustWeight improperly replicates

3 Likes

This probably should have been an Engine Bugs thread but New Members are restricted from that… :frowning:

EDIT: not features

If you haven’t already, you should take a look at the new member link before the staffs/contributors start yeetin’ on you. It does tell you how to make requests to threads you don’t have access to.

https://devforum.roblox.com/t/new-member-program-faq/83329

1 Like

Yikes, thought I’ve already covered that thread already. That’s a big whoopsies from my end.

1 Like

That’s good that it prevented you from doing that, because this is not currently formatted as a feature request. Recommend reading the post linked above + reading over the pinned posts in the Platform Feedback category to get more familiar with the desired posting format for that category.

2 Likes

Does it normally replicate when you’re not using the AdjustWeight() function?

1 Like

I’m pretty sure that weight replicates…

Who’s creating the Animation object? Make sure it’s the server. For my game I just dump all my animations in a folder and each character just loads from it.

(remember that :LoadAnimation() returns a new AnimationTrack. You’re not actually modifying the Animation, so you’re free to have multiple characters load the same Animation object.)

EDIT: Actually, also make sure that you never set the animation’s weight to 0 (see near the bottom of the thread for more info on why this is problematic)

4 Likes

I’m just not sure if weight replicates if you adjust it from the client even if the animation was created on the server.

1 Like

I’m pretty sure it does. It’s what I’m doing for my game right now. Besides, it would suck if it didn’t, because latency would cause animations to lag otherwise.

I just thought weight doesn’t get replicated because I know that if you adjust the animation speed from the client, the change doesn’t get replicated to the server.

1 Like

Adjusting the speed of the animation also replicates…

Not when I tried it…

1 Like

Here’s proof that it does replicate:

EDIT: For future reference, tick this setting on if you ever want to debug your animations:

image

3 Likes

You’re right, tested it out now! Aha I was literally 100% sure I were correct, but I were wrong. Glad you pointed this out so I don’t need to make extra animations for running/walking anymore. :slight_smile:

1 Like

Replicating animation weight has been an issue for years, and attempts to fix it haven’t been successful.

Upon further investigation I found out that there is one working way to replicate the weight of animations to other clients:

  • Play animations with a weight of 1 (not 0)
  • Ensure AdjustWeight never sets to 0 (0.01 at minimum)

The issue seems to be related to other clients stopping animations when Weight is set to 0. By using this workaround you can achieve your desirable effect until Roblox fixes this issue.

Here is a bug report about this issue; AnimationTrack:AdjustWeight improperly replicates - #8 by Wsly (Please give it some support to give the thread traction; like and post a link to threads describing the issue is still relevant)

7 Likes

The bug report you linked doesn’t mention the zero-weight thing. You should mention it there, too. This bug has definitely bitten me before.

EDIT: Oh now it does.

1 Like

I’ve just edited my reply to include that info. It might be worth to create a newly updated repo describing the issue with zero-weighting in detail.

I reported that problem a few months ago

1 Like

Thanks! Setting the weights to 0 was the problem this entire time.

That’s so odd how the server immediately stops keeping track of the animation weights once it’s set to 0…

2 Likes