So, I’m trying to get this emote GUI to work, and while it plays Animations fine for the most part, for some reason on most animations the arms are stuck in the pose for whatever idle the player uses, even if the arms are animated in the animation and it’s not just a lack of keyframes.
Here’s Nexus Exchange’s Caramelldansen emote loaded, and you can see the arms don’t move at all. However, if you look at the emote on the catalog, the arms should be moving (raised above the head).
This happens most of the time, but there’s a couple exceptions, like Sony’s Rasputin, where the arms are animated as they should be.
They’re set as Action4 and should override everything, so I literally do not know what’s wrong here. I’ve also tried just setting them to normal Action, as well as changing their priorities in the Animaton Editor and uploading those, all to no avail.
Here’s the animation handler:
local anims = script:WaitForChild("Animations"):GetChildren()
local templateBtn = script:WaitForChild("AnimButton")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local currentAnim = nil
for i, anim in pairs(anims) do
local loadedAnim = humanoid:LoadAnimation(anim)
loadedAnim.Looped = true
loadedAnim.Priority = Enum.AnimationPriority.Action4
local templateClone = templateBtn:Clone()
templateClone.Text = anim.Name
templateClone.Parent = script.Parent.AnimationsScroll
templateClone.MouseButton1Click:Connect(function()
if currentAnim ~= loadedAnim then
if currentAnim then
currentAnim:Stop()
local sound = char.Head.AnimationSound
sound:stop()
sound:Destroy()
end
currentAnim = loadedAnim
currentAnim:Play()
local sound = Instance.new("Sound",char.Head)
sound.Name = "AnimationSound"
local animsound = anim.Value.Value
sound.SoundId = "http://www.roblox.com/asset/?id=" .. animsound
sound.Volume = 1
sound.RollOffMaxDistance = 30
sound.RollOffMinDistance = 10
sound:play()
sound.Looped = true
elseif currentAnim == loadedAnim then
local sound = char.Head.AnimationSound
sound:stop()
sound:Destroy()
currentAnim:Stop()
currentAnim = nil
end
end)
end
Is this an animation weight issue or something? I have no idea how it could be keyframes, especially if the arms are supposed to be animated like in Caramelldansen.
Please provide code samples if you can, that’s how I learn best and how animations and especially their priorities work genuinely baffle me.
I hope your not using the marketplace Id, as its not the actual animation Id. You need a Plugin like BTRoblox to get direct access to its dependencies.
Your code looks fine to me, just some considerations;
Use .Activated Instead.
Ensure the (Image/Text)Button has Active set to True
And as @Contadoskidkk mentioned, use Roblox’s Animator Instance to load animations Instead, The solver should’ve already warned you, If you TypeChecked it.
The idle animation I am personally using is from one of the many animation packages Roblox sells. You can see it in the GIFs I provided- it’s the Popular idle, and there’s no reason it should be on any of the Actions or override these.
I didn’t manually set the idle, it’s just whatever idle the user happens to have applied to themselves.
Even on changing all the animations to none or the default, the arms will still hold whatever position they’re in. On a Dummy the arms animate just fine, so it’s still not the animation itself’s fault.
I also tried stopping all animations playing on the character just before playing the emote, and the arms still won’t animate. This doesn’t seem like an overriding issue…
It was my ragdoll script.
Outright disabling the ragdoll scripts in the Workspace fixes the issue, but also you know, disables ragdoll entirely.
I tried disabling the ragdoll scripts when a player uses an emote, but that doesn’t work. Neither does temporarily moving all the constraints generated, doing both at the same time, or moving the entirety of the ragdoll scripts’ folder and then adding it back after the emote disables.
What’s up here?
local anims = script:WaitForChild("Animations"):GetChildren()
local templateBtn = script:WaitForChild("AnimButton")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
--local ragconstraints = char:WaitForChild("RagdollConstraints")
--local collision = char:WaitForChild("CollisionConstraints")
--local replicatedstorage = game:GetService("ReplicatedStorage")
--local constraintstorage = Instance.new("Folder",replicatedstorage)
--constraintstorage.Name = char.Name .. "ConstraintStore"
--local startergui = script.Parent.Parent.Parent.Parent
--local ragscripts = startergui:WaitForChild("ragdoll")
--local ragserver = ragscripts.ragdollserver
--local ragclient = ragscripts.ragdollclient
local currentAnim = nil
for i, anim in pairs(anims) do
local loadedAnim = humanoid.Animator:LoadAnimation(anim)
loadedAnim.Looped = true
loadedAnim.Priority = Enum.AnimationPriority.Action
local templateClone = templateBtn:Clone()
templateClone.Text = anim.Name
templateClone.Parent = script.Parent.AnimationsScroll
templateClone.MouseButton1Click:Connect(function()
if currentAnim ~= loadedAnim then
if currentAnim then
currentAnim:Stop()
local sound = char.Head.AnimationSound
sound:stop()
sound:Destroy()
--ragconstraints.Parent = char
--collision.Parent = char
--ragserver.Enabled = true
--ragclient.Enabled = true
end
--ragserver.Enabled = false
--ragclient.Enabled = false
--ragconstraints.Parent = constraintstorage
--collision.Parent = constraintstorage
wait(0.01)
currentAnim = loadedAnim
currentAnim:Play()
local sound = Instance.new("Sound",char.Head)
sound.Name = "AnimationSound"
local animsound = anim.Value.Value
sound.SoundId = "http://www.roblox.com/asset/?id=" .. animsound
sound.Volume = 1
sound.RollOffMaxDistance = 30
sound.RollOffMinDistance = 10
sound:play()
sound.Looped = true
elseif currentAnim == loadedAnim then
local sound = char.Head.AnimationSound
sound:stop()
sound:Destroy()
currentAnim:Stop()
currentAnim = nil
--ragconstraints.Parent = char
--collision.Parent = char
--ragserver.Enabled = true
--ragclient.Enabled = true
end
end)
end
Everything’s in comments on purpose, it’s just not working so I’ve disabled them in case I need the lines again.
I’m not sure why the other joints worked and it was just the arms being difficult, though…
After doing some more digging, I found the culprit, it was a stray Motor6D in the UpperTorso that was the problem.
(For anyone suffering this variant of the issue in the future, make sure to replicate this across both client and server, or else the arms will only be fixed client-side).