I have an issue where the animation for an NPC is not working. It’s supposed to be an idle animation with it’s Priority as Idle. But, it wont work, I don’t know why. The game is under a group and the animation was exported with the group as the creator.
The script:
local Animator = script.Parent.Humanoid.Animator
local Animation = Animator:LoadAnimation(script.Animation)
Animation:Play()
I have tried client-sided, server-sided, parenting the animation to the Humanoid, and creating the animation in the script too, but it doesn’t work, and nothing in the model is anchored but the HumanoidRootPart, which doesn’t effect the animation. What is wrong here?
If this doesn’t print anything, it means the animation is not playing at all. In which case try to test the game in roblox, not in studio.
If it does print, the limbs aren’t able to move due a rig error such as missing motor6ds or welds blocking them.
Usually, this can mean a few things, but mainly make sure you’re calling on the correct humanoid and calling ob the correct animation.
also set the priority as well as make sure you own the animation. (EX, get permissions)
well obviously you didnt if because what happens is (ive experienced this), someone uploads the animations but because of your group permissions it doesnt work. make sure you have access to roblox studio places of the group permission.
I made this sample for you from my past code, maybe this can help you.
-- humanoid etc,
local player = game.Players.LocalPlayer
local Character = player.Character or player.PlayerAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
-- locating animation
local Sword_Equip_Animation = Instance.new("Animation")
Sword_Equip_Animation.AnimationId = "rbxassetid://9537941896"
local AnimationTrackEquip = Humanoid:LoadAnimation(Sword_Equip_Animation)
-- you can change the rbxassetid to your script.parent or just use an anim-id.
--also make sure you've defined humanoid correctly
I just forgot, so since your using this for an NPC make sure the animation type is set to R15 and your NPC is R15 (or if the NPC’s character is r5 make the animation in r5)