-- NinjoOnline --
local getModel = {}
local replicatedStorage = game:GetService('ReplicatedStorage')
local classes = replicatedStorage:WaitForChild('Classes')
function loadIdleAnimation(humanoid)
local animation = script['Idle']
if not animation then return end
local animTrack = humanoid:LoadAnimation(animation)
if not animTrack then return end
animTrack.Looped = true
animTrack:Play()
end
function getModel:Class(selected)
local classFolder = classes:FindFirstChild(selected)
if not classFolder then return end
local classModel = classFolder:FindFirstChild('Armour')
if not classModel then return end
local clone = classModel:Clone()
clone.Name = 'ClassDummy'
if workspace:FindFirstChild('ClassDummy') then
workspace.ClassDummy:Destroy()
end
for _, v in pairs(clone:GetChildren()) do
if v:IsA('Part') or v:IsA('MeshPart') then
v.Anchored = true
end
end
clone.Parent = workspace
local character = clone
local humanoid = character.Humanoid
loadIdleAnimation(humanoid)
end
return getModel
This is my module script. Running locally. When I put a print inside the animation function, it printed on every line.
But no animation was playing. Their is still Animator inside the Humanoid of the model
I am not sure if this i still the case but Looped animations do not replicating to new players. By this I mean an animation that is played in a loop will only replicate to the current ingame players after this new players will not see the animation play.
I am not sure how you are using this so cannot really help with what you can use to fix this.
Edit:-
The wasy way to check if this is the cause would be to just delay the function.
I’m not sure if this helps, but have you tried setting your view to server? I don’t recall whether APS shows for both or only for the selected view. Maybe try setting it to server and see if it actually prints something.
Hi, interesting issue, got me interested in the thread. So, I noticed you didn’t debug to see if the animation was ever found. Just to be sure, you should change out this pile of code:
with:
local animation = script['Idle']
if not animation then error("something is wrong with 'animation'")
local animTrack = humanoid:LoadAnimation(animation)
if not animTrack then error("something is wrong with 'animTrack'")
Also, make sure the “script[‘idle’]” refers to an animation instance.
Tell me if something happens.
I think maybe the issue is that you’re doing this from a module. While modules are neutral (not a serverscript and not a localscript) they won’t work in that way. Try to do this from a localscript.
We know, from that, that the animation is definitely playing. There’s a couple of issues here that I can think of:
Is the character model rigged correctly? Could you provide a screenshot of the descendants of the model?
Is the animation playing, but for the wrong model? Could you identify which model the animation is playing on by, say, changing the head colour when the animation plays?
There’s everything inside it. Base dummy model, but I’ve used StickMasterLuke’s Wear Bundle plugin to get roblox bundles to replace the Mesh and TextureID of the default dummy to match the bundle