Why does my animation play in studio but not in game(no group)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want my animation to play in roblox
  2. What is the issue?
    Animation only playing in studio
  3. What solutions have you tried so far?
    I looked for solutions to this but sadly most of them are because the animation was not made under the group

My script:

local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local key  = Enum.KeyCode.Q
local debounce = false
local hum = char:FindFirstChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local dash = Instance.new("Animation")
dash.AnimationId = "rbxassetid://17801920491"
local animation = animator:LoadAnimation(dash)
local dash2 = Instance.new("Animation")
dash2.AnimationId = "rbxassetid://17802237793"
local animation2 = animator:LoadAnimation(dash2)

local currentdash = 1
local distance = 2

uis.InputBegan:Connect(function(input,chat)
	if chat then return end
	if input.KeyCode == key then
		if debounce == true then return end
		debounce = true

		if math.round(currentdash%2) == 1 then
			animation2:Play()
		else
			animation:Play()
		end
		currentdash += 1
		animation:AdjustSpeed(1.9)
		animation2:AdjustSpeed(1.9)
		for count = 20,0,-1 do
			local detect = Instance.new("Part")
			detect.Size = Vector3.new(1,1,1)
			detect.Parent = workspace
			detect.CanCollide = false
			detect.Anchored = true
			detect.CFrame = hrp.CFrame * CFrame.new(0,0,distance * -1)
			local area = detect:GetTouchingParts()
			if #area == 0 then
				hrp.CFrame = hrp.CFrame * CFrame.new(0,0,distance * -1)
			else
				hrp.CFrame = hrp.CFrame * CFrame.new(0,0,distance * 2)
			end
			detect:Destroy()
			
			task.wait()
		end
		debounce = false
	end
end)

The animations are published under my name and the game is published by me

1 Like

The animation might not work in the game due to how long ago you uploaded the animation. How long ago did you upload it?

1 Like

the animation was published quite recently tho

1 Like

well that probably means its under roblox moderation, youll be able to see it but no one else will

1 Like

how long will moderation take?

1 Like

beats me. Its pretty random tbh. Hopefully a week at most

1 Like

I doubt it is moderated. You should give permission to the game to use the animations.

1 Like

well if I recall correctly animations will need to go through a form of moderation before they can be seen by all. Dont quote me but Im pretty sure

1 Like
  1. Animations aren’t moderated. Only the names and descriptions are screened. There seems to be a misconception that it does get moderated but that was when uploading animations were new.
  2. How long ago animations are uploaded does not affect whether they work in the game. I have animations uploaded many years ago, probably older than some players on the platform and they load and work instantly in the game.

For OP, check if there are any errors in-game (you can see them by pressing F9 to open the Developer console). Sometimes the studio environment is different and there may be hidden errors that only propagate in the actual game. Also, look for something like “Failed to load animation/asset” with IDs similar to those given in the script. Should tell you what’s going on.

1 Like

For the record thats not what I meant at all, the newer they are for some reason just seem not to work is what I was saying, Idk if its just me but thats how it is for me at least, and yeah it being moderated was the only thing I thought could be going on so thats what I said (probably shouldnt do that again lol).

Any how good pointers

1 Like

i checked the errors in roblox there was nothing related to the animation

1 Like

what should happen(roblox studio):
https://gyazo.com/aab5c81c86ea52af1b6dc47a882a42e9
what is happening(roblox):
https://gyazo.com/52ffd9311378b5fcc005e9b4d5b1e331

1 Like

Personally, I’m not a big fan of playing animations through the client.
So instead, how about we take a different approach to our situation?

First, we create a RemoteEvent in ReplicatedStorage.
We then create a script in ServerScriptService which is in charge of handling the animation.

Let’s also create an animation object in ReplicatedStorage. This animation object will also have our animation ID.

Now in your script in ServerScriptService, put this in:

local ReplicatedStorage = game:GetService("ReplicatedStorage");
local animation = ReplicatedStorage.Animation;
local remote = ReplicatedStorage.RemoteEvent;

remote.OnServerEvent:Connect(function(plr)
	if not plr then return end;
	
	local Character = plr.Character;
	local Animator = Character.Humanoid.Animator;
	local AnimationTrack = Animator:LoadAnimation(animation);
	
	AnimationTrack:Play()
	
	return
end)

Now, this is interchangeable to your liking. Be aware that you may have to make a function for separate animations.

In your localscript, we can replace the animations being called with:

RemoteEvent:FireServer();

So, how should this help?

Well, when you play an animation through the client, it often bugs out when it tries to be replicated to the server. This ensures that the animation is played through the server instead, which includes the speed it’s adjusted to.

I hope this helps!

1 Like

thanks i server sided the animations now its working in the studio and in the game thanks for your solution

1 Like