My animations in my game are glitching, I use a GUI to fire a remote event which then changes the animations on the server. The animations load, but they sort of clip into place?
Video:
Server Script which changes the animations:
local RemoteEvent = game:GetService('ReplicatedStorage').SetupEvents.GenderSelect
local function ServerEvent(Player, FemaleOrMale)
if (FemaleOrMale == 'Female') then
local animate = Player.Character:FindFirstChild("Animate")
animate.run.RunAnim.AnimationId = "rbxassetid://9438134768"
animate.idle.Animation1.AnimationId = "rbxassetid://9750337322"
animate.idle.Animation2.AnimationId = "rbxassetid://9750337322"
Player.Character:FindFirstChild("PlayerConfig").Gender.Value = 'Female'
elseif (FemaleOrMale == 'Male') then
local animate = Player.Character:FindFirstChild("Animate")
animate.run.RunAnim.AnimationId = "rbxassetid://9741977712"
animate.idle.Animation1.AnimationId = "rbxassetid://9752998959"
animate.idle.Animation2.AnimationId = "rbxassetid://9752998959"
Player.Character:FindFirstChild("PlayerConfig").Gender.Value = 'Male'
end
end
RemoteEvent.OnServerEvent:Connect(ServerEvent)
each roblox animate script that is mainly responsible for the core animations of a player controlled character are always made to be ālocal scriptsā
since youāre only using a GUI, you can simply copy and erase the server script and paste the content in the local and it will not glitch longer as server-sided replications have latencies
it looks fine on the CLIENT, but to other players the animations are very weird
video:
iām not sure if itās clear on the video, but the animations are sort of merging together to create a weird mess of idle and walking animations mixed with whatever animations the player has on their avatar
i tried changing the animations in the server script, but it made no difference
if the āmergingā is the case, then preemptively just a check, try clearing the default animations with this code before inserting the new ones and see if it fixes the issue
local AnimationTracks = humanoid:GetPlayingAnimationTracks()
-- Stop all playing animations
for i, track in pairs (AnimationTracks) do
track:Stop()
end