AnimationController

非推奨を表示

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。

Humanoid の代わりに、アニメーションをロードしてキャラクターまたはモデルに適用できるオブジェクト。 アニメーションを作成し、アニメーションをロードして、 キャラクターを更新し、アニメーションアセットにリンクされた オブジェクトによって反応する方法を更新します。

このクラスの LoadAnimation() メソッドは廃止されました。代わりに、Studio で手動で作成してスクリプトで直接参照できる から直接呼び出す必要があります。廃止されたメソッドが AnimationController から呼び出されると、コントローラー自体は、ロードする予定のアニメーションに関して何もしませんが、ロード呼び出しとアニメーションIDが移行される Animator に自動的に生成するだけです。この方法では、AnimationController は、アニメーションに関する実際の機能を処理する子供の 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()

プロパティ

方法

イベント