Short and simple explanation of issue :
When I play my animation in the editor, it’s fine. When I go in studio to test it, my animation plays, but the idle animation and walk animation plays over it. (The default roblox animation packages)
But no matter what, it doesn’t give me any errors of what’s happened.
Longer explanation :
I didn’t realise this until I equipped one of the more emotive packages, such as the ninja idle. It tries to play both animations, even though i’ve added and animated keyframes to the animation. No matter what I try, it keeps playing over it. I thought maybe something else was interfering with the script, so I removed my suspect but yet it still broke. I don’t know if it’s the script or something else.
Solutions I’ve tried :
- Tried setting setting walkspeed and jumpheight to 0. (Setting the jump to 0 works, but the walkspeed keeps on going.)
- Using a script from a tutorial (It still plays over it)
- Using multiple different script attempts
- Setting the animation to the highest priority. (Action)
- Making a new animation and replacing it
The current script I’m using :
Oh and by the way, i’m very new to scripting since animation and modelling was my focus.
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Button = script.Parent
local Animator = Character:WaitForChild("Humanoid"):WaitForChild("Animator")
local Animation = script:WaitForChild("RelaxSit")
local Debounce = false
local IsPlaying = false
local function PlayAnimation()
print("Playing animation")
Debounce = true
local LoadAnimation = Animator:LoadAnimation(Animation)
LoadAnimation:Play()
IsPlaying = true
LoadAnimation.Stopped:Wait()
IsPlaying = false
Debounce = false
print("Animation ended")
end
Button.MouseButton1Click:Connect(function()
print("Button fired")
if Debounce == false then
if IsPlaying then
print("Stopping animation")
local LoadAnimation = Animator:LoadAnimation(Animation)
LoadAnimation:Stop()
IsPlaying = false
else
PlayAnimation()
end
end
end)
Images
This is what it looks like with the ninja idle equipped