学ぶ
エンジンクラス
Animator

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


概要
イベント
継承されたメンバー

APIリファレンス
プロパティ
EvaluationThrottled
読み取り専用
複製されていません
並列書き込み
機能: Animation
Animator.EvaluationThrottled:boolean

PreferLodEnabled
並列読み取り
機能: Animation
Animator.PreferLodEnabled:boolean

RootMotion
読み取り専用
複製されていません
閲覧できません
並列書き込み
機能: Animation
Animator.RootMotion:CFrame

RootMotionWeight
読み取り専用
複製されていません
閲覧できません
並列書き込み
機能: Animation
Animator.RootMotionWeight:number

方法
ApplyJointVelocities
機能: Animation
Animator:ApplyJointVelocities(motors:Variant):()
パラメータ
motors:Variant
戻り値
()

GetPlayingAnimationTracks
機能: Animation
シミュレーションへのアクセス
Animator:GetPlayingAnimationTracks():{any}
戻り値

GetTrackByAnimationId
機能: Animation
シミュレーションへのアクセス
Animator:GetTrackByAnimationId(animationId:ContentId):AnimationTrack?
パラメータ
animationId:ContentId
戻り値
コードサンプル
IDによるアニメーショントラックの取得
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ANIM_ID = "rbxassetid://2515090838"
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
-- キャラクターのヒューマノイドにアニメーターオブジェクトが含まれていることを確認する
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
-- 新しいAnimationインスタンスを作成し、アニメーションアセットIDを割り当てる
local kickAnimation = Instance.new("Animation")
kickAnimation.AnimationId = ANIM_ID
-- アニメーターにアニメーションを読み込む
local kickAnimationTrack = animator:LoadAnimation(kickAnimation)
-- 短い遅延の後にアニメーショントラックを再生する
task.wait(3)
kickAnimationTrack:Play()
local startTime = tick()
RunService:BindToSimulation(function(deltaTime: number)
if tick() - startTime > 1 then
-- IDによってトラックを取得し、その再生を停止する
local kickTrack = animator:GetTrackByAnimationId(ANIM_ID)
if kickTrack and kickTrack.IsPlaying then
kickTrack:Stop()
end
end
end)

LoadAnimation
機能: Animation
シミュレーションへのアクセス
Animator:LoadAnimation(animation:Animation):AnimationTrack
パラメータ
animation:Animation

RegisterEvaluationParallelCallback
機能: Animation
Animator:RegisterEvaluationParallelCallback(callback:function):()
パラメータ
callback:function
戻り値
()

StepAnimations
プラグインのセキュリティ
機能: Animation
Animator:StepAnimations(deltaTime:number):()
パラメータ
deltaTime:number
戻り値
()
コードサンプル
スタジオでのアニメーションのプレビュー
local RunService = game:GetService("RunService")
local function previewAnimation(model, animation)
-- AnimationController と Animator を見つける
local animationController = model:FindFirstChildOfClass("AnimationController")
local animator = animationController and animationController:FindFirstChildOfClass("Animator")
if not animator then return end
-- Animation を読み込んで AnimationTrack を作成する
local track = animationController:LoadAnimation(animation)
track:Play()
-- アニメーションをプレビューする
local startTime = tick()
while (tick() - startTime) < track.Length do
local step = RunService.Heartbeat:wait()
animator:StepAnimations(step)
end
-- アニメーションを停止する
track:Stop(0)
animator:StepAnimations(0)
-- ジョイントをリセットする
for _, descendant in pairs(model:GetDescendants()) do
if descendant:IsA("Motor6D") then
local joint = descendant
joint.CurrentAngle = 0
joint.Transform = CFrame.new()
end
end
end
local character = script.Parent
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://507765644"
previewAnimation(character, animation)

イベント
AnimationPlayed
機能: Animation
Animator.AnimationPlayed(animationTrack:AnimationTrack):RBXScriptSignal
パラメータ
animationTrack:AnimationTrack

©2026 Roblox Corporation。Roblox(ロブロックス)、RobloxロゴおよびPowering Imaginationは、米国並びにその他の国における登録商標および非登録商標です。