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
anim:Play()
-- 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
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
anim:Play()
needToPlay = false
else
print("i ain't going to play bro")
end
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
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