学ぶ
エンジンクラス
Selection
作成できません
サービス

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


概要
プロパティ
方法
Add(instancesToAdd: Instances):()
Get():Instances
Remove(instancesToRemove: Instances):()
Set(selection: Instances):()
継承されたメンバー
コードサンプル
選択
local Selection = game:GetService("Selection")
for _, object in pairs(Selection:Get()) do
if object:IsA("BasePart") then
object.CFrame = object.CFrame * CFrame.Angles(0, math.pi / 2, 0)
end
end

APIリファレンス
プロパティ
SelectionThickness
読み取り専用
複製されていません
並列読み取り
機能: Basic
Selection.SelectionThickness:number

方法
Add
プラグインのセキュリティ
機能: Basic
Selection:Add(instancesToAdd:Instances):()
パラメータ
instancesToAdd:Instances
戻り値
()

Get
プラグインのセキュリティ
機能: Basic
Selection:Get():Instances
戻り値
Instances
コードサンプル
選択
local Selection = game:GetService("Selection")
for _, object in pairs(Selection:Get()) do
if object:IsA("BasePart") then
object.CFrame = object.CFrame * CFrame.Angles(0, math.pi / 2, 0)
end
end
選択.SelectionChanged
local selection = game:GetService("Selection")
selection.SelectionChanged:Connect(function()
print("選択に含まれるアイテムは " .. #selection:Get() .. " 個です。")
end)

Remove
プラグインのセキュリティ
機能: Basic
Selection:Remove(instancesToRemove:Instances):()
パラメータ
instancesToRemove:Instances
戻り値
()

Set
プラグインのセキュリティ
機能: Basic
Selection:Set(selection:Instances):()
パラメータ
selection:Instances
戻り値
()
コードサンプル
選択セット
local Selection = game:GetService("Selection")
local newSelection = {}
for _, object in pairs(workspace:GetDescendants()) do
if object:IsA("BasePart") and object.BrickColor == BrickColor.new("Bright red") then
table.insert(newSelection, object)
end
end
Selection:Set(newSelection)

イベント
SelectionChanged
機能: Basic
Selection.SelectionChanged():RBXScriptSignal
コードサンプル
選択.SelectionChanged
local selection = game:GetService("Selection")
selection.SelectionChanged:Connect(function()
print("選択に含まれるアイテムは " .. #selection:Get() .. " 個です。")
end)

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