AnimationController

사용되지 않는 항목 표시

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.

Humanoid 대신 캐릭터나 모델에 애니메이션을 로드하고 적용할 수 있는 개체입니다. 를 생성하고 애니메이션을 로드하여 애니메이션 자산에서 참조하는 개체에 의해 설명된 방식으로 해당 캐릭터를 업데이트하여 반응합니다. Creates an and loads animations to update of said character to react in the way that is described within the animation asset referenced by an object.

이 클래스의 LoadAnimation() 메서드가 사용되지 않는다는 점에 유의하십시오.대신, Studio에서 수동으로 생성하고 스크립트에서 직접 참조할 수 있는 에서 직접 호출해야 합니다.사용되지 않는 메서드가 AnimationController 에서 호출되면 컨트롤러 자체는 로드할 애니메이션 외에는 아무것도 하지 않으며, 로드 호출과 애니메이션 ID가 전송되는 Animator 에 자동으로 생성됩니다.이런 방식으로, 는 애니메이션과 관련된 실제 기능을 처리하는 자식 개체에 대한 빈 껍데기 이상으로 생각할 수 있습니다.

코드 샘플

This code sample demonstrates how an AnimationController can be used in place of a Humanoid for non player character objects.

A basic rig is loaded using InsertService and the default Humanoid is replaced with an AnimationController. An AnimationTrack is then created and played.

Using an AnimationController to animation non-player objects

local InsertService = game:GetService("InsertService")
-- Load a model for demonstration
local npcModel = InsertService:LoadAsset(516159357):GetChildren()[1]
npcModel.Name = "NPC"
npcModel.PrimaryPart.Anchored = true
npcModel:SetPrimaryPartCFrame(CFrame.new(0, 5, 0))
npcModel.Parent = workspace
-- Replace the humanoid with an animationcontroller
local humanoid = npcModel:FindFirstChildOfClass("Humanoid")
humanoid:Destroy()
local animationController = Instance.new("AnimationController")
animationController.Parent = npcModel
-- Create and load an animation
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=507771019" -- Roblox dance emote
local animationTrack = animationController:LoadAnimation(animation)
-- Play the animation
animationTrack:Play()

속성

메서드

이벤트