I have no clue why it’s happening, but the code looks fairly normal to me. The object I’m referring to here is a non-humanoid model (uses AnimationController).
Code:
local function Light(Object,Type)
local ClassObject = nil
local Animation = nil
if Object.Name == "LightL" then
ClassObject = game.Workspace["Core scripts"].Lights.Animations.Left:WaitForChild(tostring(Type))
elseif Object.Name == "LightR" then
ClassObject = game.Workspace["Core scripts"].Lights.Animations.Right:WaitForChild(tostring(Type))
end
local Animation = Object.AnimationController.Animator:LoadAnimation(ClassObject)
Animation:Play()
repeat
wait()
until LightModeActivated.Value == false
Animation:Stop()
coroutine:yield()
end
local connection = task.defer(Light,object,Type)
Maybe try actually creating an Instance of the animation through script and loading the animation that way. I know that is quite a length task, but it might reveal more of the problem.
the script doesn’t directly target the actual humanoid, its directing to something called “Animator”
fix it so it targets the humanoid directly, not the “Animator”
Well that now reveals that it’s likely just not organised properly, at least your explorer tree.
That’s an assumption, but it would be nice if we can see the Explorer.
Try writing “local ClassObject = nil” as “local ClassObject” since what I think is happening, is that the LoadAnimation is prioritizing your first “local ClassObject = nil” while ignoring the other ClassObject.