The title says it all, i load the animation using a animator, and the animation randomly plays or not. i have no idea what causes this, as it worked perfectly fine a couple weeks ago when i was testing it.
heres the part of the script that plays the animation:
local CameraToSwitch = game.Workspace.Viewmodel2.CameraBone
local animation = game.Workspace.Viewmodel2.IdleAnimation
local humanoid = game.Workspace.Viewmodel2:WaitForChild("Humanoid")
local anim = humanoid.Animator:LoadAnimation(animation)
CurCamera.CameraType = Enum.CameraType.Attach
CurCamera.CameraSubject = CameraToSwitch
CurCamera.CFrame = CameraToSwitch.CFrame
-- rest of code that isnt important, it gets stuck on the line above
If the animation plays, the script continues and if the animation doesnt play it gets stuck on anim:Play() forever
There are no errors in output btw
edit: i removed the animation.Stopped:Wait(), now the only problem is that the animation randomly doesnt play
What’s the animation’s Priority?
im pretty sure its action, although i tried to change it to action4, and nothing changed it was still randomly playing or not
You could try to add a print before and after the
anim:Play() to see if it does everything correctly beforehand
i did that, it prints before and after the line, but the animation still randomly plays
That’s weird, I actually have no clue
Same here, i spent multiple hours rewriting the code yet nothing changed, it works like a roulette where it can either play or not.
Can you try and add a boolean before the animation plays and when the animation about to play, check if the boolean were true and then set it to false, not very sure this would work but it definitely something i’d try
Something like this
local needToPlay = true
if needToPlay == true then
needToPlay = false
print("i ain't going to play bro")
Also this is better if you put it in a event so you don’t have to set the boolean to true later on in order to play the animation once again.
Edit : i just realized i did it wrong, i thought the problem were animations plays and doesn’t stop
its okay, thanks for trying to help anyway lol the issue is that the animation randomly plays or doesnt play
it looks like im not the only one with this issue, i found two posts one on reddit and one on devforum with the same issue
how about stopping other animations
for i,v in pairs(c.Humanoid:GetPlayingAnimationTracks())
if v.Animation.AnimationId ~= animation.AnimationId then
hey, i doubt that will work since the animation is for a model of hands which play only one animation, and not a npc / character but ill try
where in the script would i place this? before playing the animation?
yes that would be fine to put it there.
sadly it didnt fix it, still randomly plays / doesnt play thanks for the effort though
After a couple of days, the animations randomly fixed themselves what is roblox up to bruh.
Update: after like 2 days the animations broke again randomly its a studio bug i think
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.