学ぶ
エンジンクラス
Vector3Curve

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


概要
継承されたメンバー
コードサンプル
Vector3Curveの作成
--- Vector3Curve
local function createVector3Curve()
local vectorCurve = Instance.new("Vector3Curve")
local curveX = vectorCurve:X() -- XチャネルをアニメーションさせるFloatCurveを作成して返します
local curveY = vectorCurve:Y() -- YチャネルをアニメーションさせるFloatCurveを作成して返します
-- Zチャネルを設定しないと、Zチャネルはアニメーションされません。
-- 曲線が欠けているか、キーがない曲線はアニメーションに参加しません
local key = FloatCurveKey.new(0, 1) -- 時間0で値1のキーを作成します
curveX:InsertKey(key)
curveY:InsertKey(key)
local key2 = FloatCurveKey.new(1, 2) -- 時間1で値2のキーを作成します
curveX:InsertKey(key2)
curveY:InsertKey(key2)
return vectorCurve
end
local function testVector3Curve()
local curve = createVector3Curve()
-- 指定した時間で曲線をサンプリングします(vector3を返します)
print(curve:GetValueAtTime(0)) -- 1, 1, voidを返します
print(curve:GetValueAtTime(0.5)) -- 1.5, 1.5, voidを返します(自動接線を使用した三次補間の結果)
curve:X():RemoveKeyAtIndex(1)
curve:X():RemoveKeyAtIndex(1)
print(curve:X().Length) -- キーの数 = 0
print(curve:GetValueAtTime(0.5)) -- void, 1.5, voidを返します
end
testVector3Curve()

APIリファレンス
方法
GetValueAtTime
機能: Basic
Vector3Curve:GetValueAtTime(time:number):{any}
パラメータ
time:number
戻り値

X
機能: Basic
Vector3Curve:X():FloatCurve
戻り値

Y
機能: Basic
Vector3Curve:Y():FloatCurve
戻り値

Z
機能: Basic
Vector3Curve:Z():FloatCurve
戻り値

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