The animation priority is not replicated on the server and other clients

Animation priority is not replicated on the server and other clients.

Video:

I wanna mix default walking animation with my animation

I searched for an answer for 8-10 hours and still nothing.

Script:

--Services
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RepStorage = game:GetService("ReplicatedStorage")
--Variables

local Player = Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
--Animations

local Crawl = Instance.new("Animation")
local Sprint = Instance.new("Animation")

Crawl.AnimationId = "rbxassetid://6036959104"
Sprint.AnimationId = "rbxassetid://6040024598"

local CrawlTrack = Humanoid:LoadAnimation(Crawl)
local SprintTrack = Humanoid:LoadAnimation(Sprint)

CrawlTrack.Priority = Enum.AnimationPriority.Action
SprintTrack.Priority = Enum.AnimationPriority.Action

local sprint = false
local crouch = false

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.Z then
		if crouch == false and sprint == false then
			crouch = true
			CrawlTrack:Play()
		else
			crouch = false
			CrawlTrack:Stop()
		end
	elseif input.KeyCode == Enum.KeyCode.LeftShift then
		if sprint == false and crouch == false then
			sprint = true
			SprintTrack:Play()
		else
			sprint = false
			SprintTrack:Stop()
		end
	end
end)
1 Like

You’re setting the priority of the animations on a LocalScript, instead of in the animation editor. You cannot replicate AnimationPriorities this way. I’d also suggest using the Humanoid.Animator for :LoadAnimation(), since it’s been deprecated.

image
RobloxStudioBeta_rIAk5jE8D6

2 Likes

I found solution, its because i use custom walking animation (this animation pack),
and after i change to rthro pack it started working properly.

I dont know why, but i think because someone from roblox set animations for this pack on action or something higher.