学ぶ
エンジンクラス
Instance
作成できません
閲覧できません

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


概要
継承されたメンバー

APIリファレンス
プロパティ
Archivable
並列読み取り
Instance.Archivable:boolean

archivable
非推奨

Capabilities
並列読み取り
機能: CapabilityControl
Instance.Capabilities:SecurityCapabilities

Name
並列読み取り
Instance.Name:string

Parent
複製されていません
並列読み取り
Instance.Parent:Instance

PredictionMode
読み取り専用
複製されていません
スクリプト作成できません
並列読み取り
Instance.PredictionMode:Enum.PredictionMode

RobloxLocked
非推奨

Sandboxed
複製されていません
並列読み取り
機能: CapabilityControl
Instance.Sandboxed:boolean

UniqueId
複製されていません
Robloxのスクリプトセキュリティ
Robloxのセキュリティ
並列読み取り
Instance.UniqueId:UniqueId

方法
AddTag
Instance:AddTag(tag:string):()
パラメータ
tag:string
戻り値
()

children
非推奨

ClearAllChildren
Instance:ClearAllChildren():()
戻り値
()

Clone
機能: CreateInstances
シミュレーションへのアクセス
Instance:Clone():Instance
戻り値
コードサンプル
インスタンスのクローン作成
local Workspace = game:GetService("Workspace")
-- 既存のオブジェクトへの参照を取得
local model = script.Parent.Model
-- モデルのクローンを作成
local clone = model:Clone()
-- クローンを移動して、元のモデルと重ならないようにする
clone:PivotTo(model.PrimaryPart.CFrame - (Vector3.xAxis * 10))
-- クローンをWorkspaceに追加
clone.Parent = Workspace

clone
非推奨

Destroy
Instance:Destroy():()
戻り値
()
コードサンプル
インスタンス:Destroy()
local part = script.Parent.Part
part:Destroy()

destroy
非推奨

FindFirstAncestor
並列書き込み
Instance:FindFirstAncestor(name:string):Instance?
パラメータ
name:string
戻り値

FindFirstAncestorOfClass
並列書き込み
Instance:FindFirstAncestorOfClass(className:string):Instance?
パラメータ
className:string
戻り値

FindFirstAncestorWhichIsA
並列書き込み
Instance:FindFirstAncestorWhichIsA(className:string):Instance?
パラメータ
className:string
戻り値

FindFirstChild
並列書き込み
シミュレーションへのアクセス
Instance:FindFirstChild(
name:string, recursive:boolean
パラメータ
name:string
recursive:boolean
既定値: false
戻り値
コードサンプル
インスタンス:FindFirstChild
local found = workspace:FindFirstChild("Brick")
if found then
found.Name = "Foo"
end

findFirstChild
非推奨

FindFirstChildOfClass
並列書き込み
Instance:FindFirstChildOfClass(className:string):Instance?
パラメータ
className:string
戻り値
コードサンプル
インスタンス: クラスの最初の子を見つける
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid
while not humanoid do
humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then
character.ChildAdded:Wait()
end
end

FindFirstChildWhichIsA
並列書き込み
シミュレーションへのアクセス
Instance:FindFirstChildWhichIsA(
className:string, recursive:boolean
パラメータ
className:string
recursive:boolean
既定値: false
戻り値

FindFirstDescendant
並列書き込み
Instance:FindFirstDescendant(name:string):Instance?
パラメータ
name:string
戻り値

GetActor
並列書き込み
Instance:GetActor():Actor?
戻り値

GetAttribute
並列書き込み
シミュレーションへのアクセス
Instance:GetAttribute(attribute:string):Variant
パラメータ
attribute:string
戻り値
Variant

GetAttributeChangedSignal
Instance:GetAttributeChangedSignal(attribute:string):RBXScriptSignal
パラメータ
attribute:string

GetAttributes
並列書き込み
シミュレーションへのアクセス
Instance:GetAttributes():Dictionary
戻り値

GetChildren
並列書き込み
シミュレーションへのアクセス
Instance:GetChildren():Instances
戻り値
Instances
コードサンプル
インスタンス:GetChildren
local children = workspace:GetChildren()
for i = 1, #children do
print(i, children[i].Name)
end

getChildren
非推奨

GetDebugId
閲覧できません
プラグインのセキュリティ
Instance:GetDebugId(scopeLength:number):string
パラメータ
scopeLength:number
既定値: 4
戻り値
コードサンプル
インスタンス:GetDebugId
print(workspace:GetDebugId()) --> 39FA_12
print(workspace:GetDebugId(10)) --> 39FA2FEF4D_12
print(workspace:GetDebugId(math.huge)) --> 12

GetDescendants
並列書き込み
シミュレーションへのアクセス
Instance:GetDescendants():Instances
戻り値
Instances
コードサンプル
インスタンス:GetDescendants
local descendants = workspace:GetDescendants()
-- ワークスペースのすべての子孫をループします。もし
-- BasePart が見つかった場合、コードはその部品の色を緑に変更します
for _, descendant in pairs(descendants) do
if descendant:IsA("BasePart") then
descendant.BrickColor = BrickColor.Green()
end
end

GetFullName
並列書き込み
シミュレーションへのアクセス
Instance:GetFullName():string
戻り値
コードサンプル
インスタンス:GetFullName
-- 単純な階層を作成
local model = Instance.new("Model")
local part = Instance.new("Part")
part.Parent = model
local fire = Instance.new("Fire")
fire.Parent = part
print(fire:GetFullName()) --> Model.Part.Fire
model.Parent = workspace
print(fire:GetFullName()) --> Workspace.Model.Part.Fire
part.Name = "Hello, world"
print(fire:GetFullName()) --> Workspace.Model.Hello, world.Fire
インスタンス:GetFullName Lua 実装
local function getFullName(object)
local result = object.Name
object = object.Parent
while object and object ~= game do
-- 親の名前を先頭に追加
result = object.Name .. "." .. result
-- 階層を上がる
object = object.Parent
end
return result
end
print(getFullName(workspace.Camera)) --> Workspace.Camera

GetStyled
Instance:GetStyled(
name:string, selector:string?
):Variant
パラメータ
name:string
selector:string?
戻り値
Variant

GetStyledPropertyChangedSignal
Instance:GetStyledPropertyChangedSignal(property:string):RBXScriptSignal
パラメータ
property:string

GetTags
並列書き込み
シミュレーションへのアクセス
Instance:GetTags():{any}
戻り値

HasTag
並列書き込み
シミュレーションへのアクセス
Instance:HasTag(tag:string):boolean
パラメータ
tag:string
戻り値

IsAncestorOf
並列書き込み
シミュレーションへのアクセス
Instance:IsAncestorOf(descendant:Instance):boolean
パラメータ
descendant:Instance
戻り値
コードサンプル
インスタンス:IsAncestorOf()
local Workspace = game:GetService("Workspace")
local spawnLocation = Workspace.SpawnLocation
local decal = spawnLocation.Decal
-- これらの文は真です
print(Workspace:IsAncestorOf(spawnLocation))
print(Workspace:IsAncestorOf(decal))
print(spawnLocation:IsAncestorOf(decal))
-- これらの文は偽です
print(spawnLocation:IsAncestorOf(Workspace))
print(decal:IsAncestorOf(Workspace))
print(decal:IsAncestorOf(spawnLocation))

IsDescendantOf
並列書き込み
シミュレーションへのアクセス
Instance:IsDescendantOf(ancestor:Instance):boolean
パラメータ
ancestor:Instance
戻り値
コードサンプル
インスタンス:IsDescendantOf
local part = Instance.new("Part")
print(part:IsDescendantOf(game))
--> 偽
part.Parent = workspace
print(part:IsDescendantOf(game))
--> 真
part.Parent = game
print(part:IsDescendantOf(game))
--> 真

isDescendantOf
非推奨

IsPropertyModified
シミュレーションへのアクセス
Instance:IsPropertyModified(property:string):boolean
パラメータ
property:string
戻り値

QueryDescendants
シミュレーションへのアクセス
Instance:QueryDescendants(selector:string):Instances
パラメータ
selector:string
戻り値
Instances

Remove
非推奨

remove
非推奨

RemoveTag
Instance:RemoveTag(tag:string):()
パラメータ
tag:string
戻り値
()

ResetPropertyToDefault
Instance:ResetPropertyToDefault(property:string):()
パラメータ
property:string
戻り値
()

SetAttribute
シミュレーションへのアクセス
Instance:SetAttribute(
attribute:string, value:Variant
):()
パラメータ
attribute:string
value:Variant
戻り値
()

WaitForChild
イールド可能
Instance:WaitForChild(
childName:string, timeOut:number
パラメータ
childName:string
timeOut:number
戻り値
コードサンプル
インスタンス:WaitForChild
local part = workspace:WaitForChild("Part")
print(part.Name .. " はWorkspaceに追加されました")

イベント
AncestryChanged
Instance.AncestryChanged(
child:Instance, parent:Instance
パラメータ
child:Instance
parent:Instance
コードサンプル
Instance.AncestryChanged
local Workspace = game:GetService("Workspace")
local redPart = script.Parent.RedPart
local bluePart = script.Parent.BluePart
local changingPart = script.Parent.ChangingPart
-- changingPartの色を親に基づいて変更します
local function onAncestryChanged(part: Part, parent: Instance)
if parent == redPart then
changingPart.Color = Color3.new(1, 0, 0)
elseif parent == bluePart then
changingPart.Color = Color3.new(0, 0, 1)
else
changingPart.Color = Color3.new(1, 1, 1)
end
print(`{part.Name}は現在{parent.Name}に親付けされています`)
end
changingPart.AncestryChanged:Connect(onAncestryChanged)
-- changingPartのParentプロパティを時間と共に異なるインスタンスに設定します
while true do
task.wait(2)
changingPart.Parent = redPart
task.wait(2)
changingPart.Parent = bluePart
task.wait(2)
changingPart.Parent = Workspace
end

AttributeChanged
Instance.AttributeChanged(attribute:string):RBXScriptSignal
パラメータ
attribute:string

ChildAdded
Instance.ChildAdded(child:Instance):RBXScriptSignal
パラメータ
child:Instance
コードサンプル
インスタンス.ChildAdded
local function onChildAdded(instance)
print(instance.Name .. " がワークスペースに追加されました")
end
workspace.ChildAdded:Connect(onChildAdded)
local part = Instance.new("Part")
part.Parent = workspace --> パートがWorkspaceに追加されました

childAdded
非推奨

ChildRemoved
Instance.ChildRemoved(child:Instance):RBXScriptSignal
パラメータ
child:Instance
コードサンプル
インスタンス.子削除
local function onChildRemoved(instance)
print(instance.Name .. " がワークスペースから削除されました")
end
workspace.ChildRemoved:Connect(onChildRemoved)
local part = Instance.new("Part")
part.Parent = workspace
task.wait(2)
part:Destroy()

DescendantAdded
Instance.DescendantAdded(descendant:Instance):RBXScriptSignal
パラメータ
descendant:Instance
コードサンプル
インスタンス.DescendantAdded
local function onDescendantAdded(descendant)
print(descendant)
end
workspace.DescendantAdded:Connect(onDescendantAdded)
local part = Instance.new("Part")
part.Parent = workspace

DescendantRemoving
Instance.DescendantRemoving(descendant:Instance):RBXScriptSignal
パラメータ
descendant:Instance
コードサンプル
Instance.DescendantRemoving
workspace.DescendantRemoving:Connect(function(descendant)
print(descendant.Name .. " は現在 " .. tostring(descendant.Parent) .. " に親付けされています")
end)
local part = Instance.new("Part")
part.Parent = workspace
part.Parent = nil
--> パートは現在 Workspace に親付けされています
print(part.Parent)
--> nil

Destroying
Instance.Destroying():RBXScriptSignal
コードサンプル
破壊イベントの使用 (即時シグナル)
local part = Instance.new("Part", workspace)
local function onPartDestroying()
print("待機前:", part:GetFullName(), #part:GetChildren())
task.wait()
print("待機後:", part:GetFullName(), #part:GetChildren())
end
part.Destroying:Connect(onPartDestroying)
part:Destroy()
破壊イベントを使用する (遅延シグナル)
local part = Instance.new("Part", workspace)
local function onPartDestroying()
print("シグナル内:", part:GetFullName(), #part:GetChildren())
end
part.Destroying:Connect(onPartDestroying)
print("破壊前:", part:GetFullName(), #part:GetChildren())
part:Destroy()
print("破壊後:", part:GetFullName(), #part:GetChildren())

StyledPropertiesChanged
Instance.StyledPropertiesChanged():RBXScriptSignal

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