So essentially, I followed a script that someone posted for directional movement and it work great, only downside being that for one reason or another it isn’t replicated for other people.
local runService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local character = player.Character
local humRootPart = character:WaitForChild("HumanoidRootPart")
local hum = character:WaitForChild("Humanoid")
local animFolder = script:WaitForChild("Animations")
local animationsTable = {
["WalkForward"] = hum:LoadAnimation(animFolder.Walk.WalkForward),
["WalkLeft"] = hum:LoadAnimation(animFolder.Walk.WalkLeft),
["WalkRight"] = hum:LoadAnimation(animFolder.Walk.WalkRight),
}
for _, Animation in animationsTable do
Animation:Play(0, 0.01, 0)
end
runService.RenderStepped:Connect(function()
local directionOfMovement = humRootPart.CFrame:VectorToObjectSpace(humRootPart.AssemblyLinearVelocity)
local Forward = math.abs(math.clamp(directionOfMovement.Z / hum.WalkSpeed, -1, -0.001))
local Backwards = math.abs(math.clamp(directionOfMovement.Z / hum.WalkSpeed, 0.001, 1))
local Right = math.abs(math.clamp(directionOfMovement.X / hum.WalkSpeed, 0.001, 1))
local Left = math.abs(math.clamp(directionOfMovement.X / hum.WalkSpeed, -1, -0.001))
local SpeedUnit = (directionOfMovement.Magnitude / hum.WalkSpeed)
if directionOfMovement.Z/hum.WalkSpeed < 0.1 then
animationsTable.WalkForward:AdjustWeight(Forward)
animationsTable.WalkRight:AdjustWeight(Right)
animationsTable.WalkLeft:AdjustWeight(Left)
animationsTable.WalkForward:AdjustSpeed(SpeedUnit)
animationsTable.WalkRight:AdjustSpeed(SpeedUnit)
animationsTable.WalkLeft:AdjustSpeed(SpeedUnit)
else
animationsTable.WalkForward:AdjustWeight(Backwards)
animationsTable.WalkRight:AdjustWeight(Left)
animationsTable.WalkLeft:AdjustWeight(Right)
animationsTable.WalkForward:AdjustSpeed(SpeedUnit * -1)
animationsTable.WalkRight:AdjustSpeed(SpeedUnit * -1)
animationsTable.WalkLeft:AdjustSpeed(SpeedUnit * -1)
end
end)
This is the part of the script that handles the walking, but for some reason it wont show on other people’s screens.
forgot to mention but instead of RenderStepped I used PreRender since it’s not deprecated-- that was just me testing other things to see if it would work
yea, but other animations from local scripts are typically replicated. I even have other animations in the same script that ARE replicated to other clients
The issue is that you’re handling animation entirely on the client, and by default, animations played via LocalScript won’t replicate to other clients unless you’re using something like a Tool or the built-in emote system that handles replication for you. What’s likely happening is your local character is showing the correct movement animation, but since the server (and by extension, other players) never receives any information about which animation you’re playing, they just see the default idle or movement. This happens even if the animation plays fine on your end.
If you want the animation to replicate, you’ll need to trigger it through the server. You can either move your animation logic into a server Script or use RemoteEvents to let the server know what animation to play and when. Then the server can play it using the Humanoid’s Animator, which will make it visible to everyone. Otherwise, if the animation is just for first-person feedback or viewmodel visuals, and not something other players are meant to see, then keeping it local is fine, but don’t expect it to replicate.
Whether you’re using R6 or R15 will make replication approaches vary a bit depending on that.
I’m unsure how I would go about that considering the nature of the script I have. Considering it’s changing weights and speed based on the player’s movement it has me a bit lost.
Since you’re doing weight and speed blending on a per-frame basis, it’s definitely something best handled client-side, but if you want that to replicate visually, you’ll need a proxy system.
What you can do is set up a RemoteEvent that fires to the server with a simplified version of your directional state (like “Forward”, “Left”, “Right”, “Back”). Then the server receives that and plays the corresponding animation on that player’s Humanoid via server-side Animator, which does replicate. Don’t try to sync weights or speeds exactly just approximate the direction. It won’t be 1:1 but it’ll visually line up close enough.
Full animation blending like what you’re doing isn’t meant to replicate across clients. The workaround is approximating intent through server triggers and not syncing exact values. That’s how most games with movement replication fake it cleanly.
tried and still had the issue, weirder part is when testing I found that other clients can see the animation if the other person is moving left/right but not forward/backward. sometimes while moving forward the other client can see a foot move a little bit but barely enough to even notice.