Basically what I’m trying to do is have a custom model that’s been rigged in blender imported to Roblox, which I’ve done. I’ve made animations with the animation editor and they work just fine when there’s no humanoid in the custom model. Once the humanoid is added all the animations just break, which isn’t really efficient considering I need it to make the model walk, with a custom animation. Is there any solution to this? I’ve tried looking around but I haven’t found anything which is why I’m asking here. If you need anymore context feel free to let me know in the comments, since I’d like to get this to work.
Current code:
-- Ensure the NPC has an AnimationController and Animator
local animationController = script.Parent.Humanoid.AnimationController:FindFirstChild("Animator")
if not animationController then
animationController = Instance.new("Animator", script.Parent.Humanoid.AnimationController)
end
local animator = script.Parent.Humanoid.AnimationController:FindFirstChildOfClass("Animator")
-- Create and load the walking animation
local walkAnim = Instance.new("Animation")
walkAnim.Name = "walkAnim"
walkAnim.Parent = animator
walkAnim.AnimationId = "rbxassetid://15295740105"
local walkAnimationTrack = animator:LoadAnimation(walkAnim)
-- Create and load the idle animation
local idleAnim = Instance.new("Animation") --15295755216
idleAnim.Name = "idleAnim"
idleAnim.Parent = animator
idleAnim.AnimationId = "rbxassetid://15296682553"
local idleAnimTrack = animator:LoadAnimation(idleAnim)
-- Set the animations to loop
idleAnimTrack.Looped = true
walkAnimationTrack.Looped = true
-- Start the idle animation
idleAnimTrack:Play()```