Aprender
Clase de motor
AnimationController

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.


Resumen
Eventos
Miembros heredados
Muestras de código
Usando un AnimationController para animar objetos no jugadores
local InsertService = game:GetService("InsertService")
-- Cargar un modelo para demostración
local npcModel = InsertService:LoadAsset(516159357):GetChildren()[1]
npcModel.Name = "NPC"
npcModel.PrimaryPart.Anchored = true
npcModel:SetPrimaryPartCFrame(CFrame.new(0, 5, 0))
npcModel.Parent = workspace
-- Reemplazar el humanoide con un animationcontroller
local humanoid = npcModel:FindFirstChildOfClass("Humanoid")
humanoid:Destroy()
local animationController = Instance.new("AnimationController")
animationController.Parent = npcModel
-- Crear y cargar una animación
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=507771019" -- Emote de baile de Roblox
local animationTrack = animationController:LoadAnimation(animation)
-- Reproducir la animación
animationTrack:Play()

Referencia API
Métodos
GetPlayingAnimationTracks
Obsoleto

LoadAnimation
Obsoleto

Eventos
AnimationPlayed
Obsoleto

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.