#Animation not work for thé players

1 messages · Page 1 of 1 (latest)

floral grotto
#

Hello,
I'm having a problem with the animations in my game. My animations are not loading for other players, and they are not loading for me either.
I have performed all standard troubleshooting tests:

  • I used a LocalScript and a Script on the server.
  • I have checked that my animation priority is set to Action.
  • The ownership of my animations is correct (they belong to the same account or group as the game).
  • I performed a test with a default Roblox animation , and it works perfectly fine in my game.
  • I performed a test in a new game, by creating a new simple animation, but it doesn't work either.
    These tests indicate that the problem is not with the code, but rather a problem with my account or my assets.
    Could you please help me resolve this issue?
    Thank you very much.
drifting shoalBOT
#

studio** You are now Level 1! **studio

verbal forge
#

and on where you put it?

floral grotto
#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AnimationEvent = ReplicatedStorage:WaitForChild("AnimationEvent")

-- IDs de toutes les animations
local animations = {
Walk = "rbxassetid://TON_ID_DE_MARCHE",
Run = "rbxassetid://TON_ID_DE_COURSE",
Jump = "rbxassetid://TON_ID_DE_SAUT",
Idle = "rbxassetid://TON_ID_DE_IMMOBILITE" -- Ajoute l'ID de l'animation d'immobilité ici
}

local playerAnimations = {}
local currentAnimTracks = {}

-- Fonction pour arrêter toutes les animations sauf une
local function stopAllAnimations(player)
local tracks = player.Character:WaitForChild("Humanoid"):WaitForChild("Animator"):GetPlayingAnimationTracks()
for _, track in ipairs(tracks) do
if track and track.Name ~= "DefaultAnimation" then
track:Stop()
end
end
end

AnimationEvent.OnServerEvent:Connect(function(player, animType, action)
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")

stopAllAnimations(player)

local animTrack = playerAnimations[player.UserId] and playerAnimations[player.UserId][animType]

if not animTrack then
    local newAnim = Instance.new("Animation")
    newAnim.AnimationId = animations[animType]
    local newAnimTrack = animator:LoadAnimation(newAnim)
    
    if not playerAnimations[player.UserId] then
        playerAnimations[player.UserId] = {}
    end
    playerAnimations[player.UserId][animType] = newAnimTrack
    animTrack = newAnimTrack
end

animTrack:Play()

end)

#

I pût tous scipt on serverscriptservice

#

Ans this thé localsciprT local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AnimationEvent = ReplicatedStorage:WaitForChild("AnimationEvent")

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local isRunning = false

-- Gère les actions du joueur
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.LeftShift and not gameProcessedEvent then
isRunning = true
end
end)

UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
isRunning = false
end
end)

-- Met à jour l'animation à chaque image
RunService.Heartbeat:Connect(function()
local state = humanoid:GetState()
local moveDirection = humanoid.MoveDirection.Magnitude

if state == Enum.HumanoidStateType.Jumping or state == Enum.HumanoidStateType.Freefalling then
    -- Envoie le signal de saut
    AnimationEvent:FireServer("Jump", "Start")
elseif moveDirection > 0 then
    if isRunning then
        -- Envoie le signal de course
        AnimationEvent:FireServer("Run", "Start")
    else
        -- Envoie le signal de marche
        AnimationEvent:FireServer("Walk", "Start")
    end
else
    -- Envoie le signal d'immobilité
    AnimationEvent:FireServer("Idle", "Start")
end

end)

verbal forge
#

so does it only show up for you but not for other players?

floral grotto
#

And i made a remote événement i name it Animation event

verbal forge
# floral grotto Yes
   Walk = "rbxassetid://TON_ID_DE_MARCHE",
    Run = "rbxassetid://TON_ID_DE_COURSE",
    Jump = "rbxassetid://TON_ID_DE_SAUT",
    Idle = "rbxassetid://TON_ID_DEIMMOBILITE" 

whats up with this?

floral grotto
#

On what directory?

verbal forge
#

also one issue imo,
in here: for , track in ipairs(tracks) do
it should be for _, track in ipairs(tracks) do

#

idk if it works without it or not

#

just pointing it out

verbal forge
#

at the very top

#

is that intentional?

floral grotto
verbal forge
#

;sob

#

😭

floral grotto
#

Im
new

verbal forge
#

maybe you need to replace that with an ACTUAL id?

floral grotto
verbal forge
#

im just trying to figure out whats wrong with it

#

;sob

floral grotto
#

Yes but im very lost

drifting shoalBOT
#

studio** You are now Level 2! **studio

verbal forge
#

me too to be honest 😭

#

im not spanish so i dont know what it is

floral grotto
#

Cause i truc toi do this script but m'y friend dont have the Animation

#

Im not spanish too

merry plover
#

you made a second post...?

floral grotto
#

Yes

merry plover
#

close the other one

floral grotto
#

Ok

verbal forge
#

😭

floral grotto
verbal forge
#

oh

merry plover
#

toi means you

#

🇫🇷

floral grotto
#

Tes Im french

verbal forge
#

i see

verbal forge
merry plover
#

can u do what I suggested?
publish the game and test in there

verbal forge
#

;sob

floral grotto
#

🇲🇫

merry plover
floral grotto
merry plover
#

seulement pour essayer bro!

#

just check if it works in there

floral grotto
#

Yed jour probable rigth

#

So i publish but the animation dont work and i dont ses have them two now

#

@merry plover

merry plover
#

okay, for testing purposes, make a local script in startplayerscripts and put this in there

local player = game.Players.LocalPlayer

task.wait(5)

local anim = Instance.new("Animation")    
anim.AnimationId = "rbxassetid://YOURIDHERE" --// DONT FORGET TO PUT YOUR ID
    
local track = player.Character.Humanoid.Animator:LoadAnimation(anim)

track:Play()
floral grotto
#

yes but its what anim walk, run or jump

merry plover
#

doesnt matter

#

try a random one

#

I just wanna see if its about the anims or your script

floral grotto
#

Tes but its only me ans notre thé otherplanter player wdont have and the animation is glitched

merry plover
#

alright so
the reason it doesnt work on other players is because of roblox studio, only owner can see
its glitched because we prob didnt loop it properly
what matters is that, the animation did work, and the problem is your script

merry plover
#

Im going out so I can't write any code

#

if you want I can try fixing it when I return

floral grotto
#

Ok

#

Thanxs

drifting shoalBOT
#

studio** You are now Level 3! **studio

floral grotto
merry plover
#

yeah gimme a sec tho

pseudo vine
#

stop using ai

#

and learn

#

🤦‍♂️

#

use an animation object

floral grotto
floral grotto
merry plover
#

that script looks fucked

#

just use a default animator

#

and change the animations with your own

merry plover
#

you change these

pseudo vine
#

but if thats the case

#

then yes

floral grotto
#

@merry plover

floral grotto
#

@merry plover you have na idea