I have no idea how to fix this… (As you can see the client plays the animation perfectly but the person to the right does not play that person’s animation)
How I changed the default walk animation (incase I did it wrong)
Copied “Animate” in the Character
Placed it in “StarterCharacterScripts”
Changed the walk and run animation ids to http://www.roblox.com/asset/?id=3187545430 from http://www.roblox.com/asset/?id=913376220 (In both the table storing animation ids located in the localscript and the values parented to the script)
You have to change the animation from the server, rather then the client. Changing it from the client won’t be replicated across the server-client boundary.
There is a server-sided animation script that appears inside the character only while playing the game. Play test your game and grab that script, modify it with your custom animations and replace the default script with your new edited script when a player joins.
That is odd because I have played the game at first to retrieve the Animate script and the only one I saw was LocalScript. Do I have to be on the server to see it? Also if I were to be unable to retrieve the server Animate script could I copy the contents of the local one to a new server one?
I am mistaken, animations are replicated across the server. Make sure your edited animation script is added to the character by the server, not the client.
For the record, I played around with this before and still had issues. From how frequently this question comes up and the discussions around it, everyone’s mileage varies.
I had the same problem a year ago and I honestly forgot what I did to fix it. I think it had something to do with the server not recognizing the change in animation. Animations across the server-client boundary are a bit annoying and it isn’t documented well.
Make all the clients update the animation id of every other player so that the client can see it because the problem is the client can’t see other player’s animations.
Change the script to a server script to see if that may solve the issue
Hopefully I get some results.
EDIT: I’m gonna switch 2 and 1 around because 2 is simpler
#2 won’t work as changing it to a server sided script is going to cause a lot of problems. You’d be better off writing your own animation script at that point.
--[[
Purpose of this script is to patch Roblox's stupid animate script for not replicating
the walk / run animation upon other clients. This will load it in the hard way on every
character.
--]]
--|| SERVICES ||--
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--|| LOCAL ||--
local Pairs = pairs
--|| VARIABLES ||--
local Connections = {}
local function updateWalkAnimation(Player, Character)
local Data = Player:WaitForChild("Data")
local PlayerData = Data:WaitForChild("PlayerData")
local Animate = Character:WaitForChild("Animate")
local WalkAnimation = Animate.walk.WalkAnim
local RunAnimation = Animate.run.RunAnim
local IdleAnimation = Animate.idle.Animation1
if PlayerData["Fighting Style"].Value ~= "" then
WalkAnimation.AnimationId = ReplicatedStorage.Animations['Fighting Styles'][PlayerData["Fighting Style"].Value].Walk.Walk.AnimationId
RunAnimation.AnimationId = ReplicatedStorage.Animations['Fighting Styles'][PlayerData["Fighting Style"].Value].Walk.Walk.AnimationId
IdleAnimation.AnimationId = ReplicatedStorage.Animations["Fighting Styles"][PlayerData["Fighting Style"].Value].Idle.Idle.AnimationId
print("[CUSTOM ANIMATION MANAGER]: "..Player.Name.."'s Custom Animations Has Been Updated.")
else
print("[CUSTOM ANIMATION MANAGER]: "..Player.Name.."'s Fighting Style Detected As Nil.")
end
end
Players.PlayerAdded:Connect(function(Player)
local Data = Player:WaitForChild("Data")
local PlayerData = Data:WaitForChild("PlayerData")
Connections[Player.Name] = {}
Connections[Player.Name]["characterListener"] = Player.CharacterAdded:Connect(function(Character )
updateWalkAnimation(Player, Character)
end)
Connections[Player.Name]["fsListener"] = PlayerData["Fighting Style"].Changed:Connect(function()
local Character = Player.Character or Player.CharacterAdded:Wait()
updateWalkAnimation(Player, Character)
end)
end)
for _, Player in Pairs(Players:GetPlayers()) do
local Data = Player:WaitForChild("Data")
local PlayerData = Data:WaitForChild("PlayerData")
local Character = Player.Character
if Character then
updateWalkAnimation(Player, Character)
end
Connections[Player.Name]["characterListener"] = Player.CharacterAdded:Connect(function(Character)
updateWalkAnimation(Player, Character)
end)
Connections[Player.Name]["fsListener"] = PlayerData["Fighting Style"].Changed:Connect(function()
Character = Player.Character or Player.CharacterAdded:Wait()
updateWalkAnimation(Player, Character)
end)
end
Players.PlayerRemoving:Connect(function(Player)
local connectionCount = 0
for username, connections in Pairs(Connections) do
if username == Player.Name then
for _, connection in Pairs(connections) do
connectionCount = connectionCount + 1
connection:Disconnect()
end
end
end
print("[CUSTOM ANIMATION MANAGER]: Cleared up "..connectionCount.." connections!")
end)
print("[CUSTOM ANIMATION MANAGER]: CUSTOM ANIMATION MANAGER HAS BEEN LOADED.")
So I attempted to basically update it for all the clients but it seems like that’s not a solution. Honestly I have no clue anymore
By placing a script in StarterCharacterScripts, the server is automatically doing the heavy lifting by cloning its contents into the character during the character spawning procedure.
Between making a manual distribution script and using StarterCharacterScripts, there is no difference other than the purpose of the latter being to add character scripts in the first place and the former being unnecessary work for something provided natively.
The walk animation is only used for mobile when the player drags the thumbstick a little way’s distance from the original position. The walk and run animation blend depending on how far the player drags the thumbstick. For computer, only the run animation is used.
That would be why changing the run animation gets it down for you but changing the walk animation doesn’t.
Yea but that still doesn’t explain why changing both the walk and run animation to the desired id breaks the run animation. The only reason I could think of is that if the run and walk animation are the same id they both try to use the same animation (because same id) and that somehow breaks it