I have 2 animations for a simulator one is for “eat” the other is “attack” they both play when the player clicks on the ui and then clicks on the screen, just as other simulators.
For some reason, both animations work fine in studio testing but in-game the attack animation works but the eat animation does not. Both animations are published under the same group, both should be working just fine
We have tried re-publishing the animation and that hasn’t worked. It can’t be anything with the animation script otherwise both anims wouldn’t be working.
If y’all need me to show anything please just ask, im honestly not sure what is causing the problem so have no idea what to show.
sorry for the late reply, this is the animationhandler script
local Player = game.Players.LocalPlayer
local AnimationHandler = {}
local Ids = {
["Eat"] = "rbxassetid://8782945776",
["Attack1"] = "rbxassetid://8780852058",
["Attack2"] = "rbxassetid://8780852058",
["Attack3"] = "rbxassetid://8780852058",
}
local LoadedAnims = {}
function AnimationHandler.PreLoad(Character)
local Hum = Character:WaitForChild("Humanoid")
for Name,Id in pairs(Ids) do
local AnimObj = Instance.new("Animation")
AnimObj.AnimationId = Id
local Anim = Hum:LoadAnimation(AnimObj)
Anim.Priority = "Action"
LoadedAnims[Name] = Anim
end
end
function AnimationHandler.PlayAnimation(Name)
if LoadedAnims[tostring(Name)] ~= nil then
LoadedAnims[tostring(Name)]:Play()
end
end
Player.CharacterAdded:Connect(function(Character)
AnimationHandler.PreLoad(Character)
end)
AnimationHandler.PreLoad(Player.Character or Player.CharacterAdded:Wait())
return AnimationHandler