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

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


概要
プロパティ
BackParamA:number
非推奨
BackParamB:number
非推奨
Elasticity:number
非推奨
Friction:number
非推奨
LeftParamA:number
非推奨
LeftParamB:number
非推奨
TopParamA:number
非推奨
TopParamB:number
非推奨
Velocity:Vector3
非推奨
方法
AngularAccelerationToTorque(angAcceleration: Vector3,angVelocity: Vector3):Vector3
ApplyImpulse(impulse: Vector3):()
ApplyImpulseAtPosition(impulse: Vector3,position: Vector3):()
BreakJoints():()
非推奨
breakJoints():()
非推奨
GetJoints():Instances
getMass():number
非推奨
GetRootPart():Instance
非推奨
GetTouchingParts():Instances
IntersectAsync(parts: Instances,collisionfidelity: Enum.CollisionFidelity,renderFidelity: Enum.RenderFidelity):Instance
MakeJoints():()
非推奨
makeJoints():()
非推奨
Resize(normalId: Enum.NormalId,deltaAmount: number):boolean
resize(normalId: Enum.NormalId,deltaAmount: number):boolean
非推奨
SetNetworkOwner(playerInstance: Player):()
SubtractAsync(parts: Instances,collisionfidelity: Enum.CollisionFidelity,renderFidelity: Enum.RenderFidelity):Instance
UnionAsync(parts: Instances,collisionfidelity: Enum.CollisionFidelity,renderFidelity: Enum.RenderFidelity):Instance
継承されたメンバー
コードサンプル
パーツのCFrameをスムーズにダンピングする
local TweenService = game:GetService("TweenService")
-- パーツとターゲットを作成
local part = Instance.new("Part", workspace)
part.Size = Vector3.one
part.Anchored = true
part.BrickColor = BrickColor.new("Electric blue")
part.CFrame = CFrame.new(0, 4, 0)
local target = Instance.new("Part", workspace)
target.Name = "Target"
target.Size = Vector3.one * 0.5
target.Anchored = true
target.BrickColor = BrickColor.new("Really red")
target.CFrame = CFrame.new(0, 8, 0)
-- 速度を保存するための変数を設定
local velocity = CFrame.new()
-- スムージング速度を調整
local smoothTime = 0.5
game:GetService("RunService").Stepped:Connect(function(t, dt)
part.CFrame, velocity = TweenService:SmoothDamp(part.CFrame, target.CFrame, velocity, smoothTime, math.huge, dt)
end)

APIリファレンス
プロパティ
Anchored
並列読み取り
シミュレーションへのアクセス
BasePart.Anchored:boolean
コードサンプル
パートの固定切替
local part = script.Parent
-- パートがクリックされたときに通知を受け取るためにClickDetectorを作成
local cd = Instance.new("ClickDetector", part)
-- この関数は、パートの固定状態に基づいて外観を更新します
local function updateVisuals()
if part.Anchored then
-- パートが固定されているとき...
part.BrickColor = BrickColor.new("明るい赤")
part.Material = Enum.Material.DiamondPlate
else
-- パートが固定されていないとき...
part.BrickColor = BrickColor.new("明るい黄色")
part.Material = Enum.Material.Wood
end
end
local function onToggle()
-- 固定プロパティを切り替える
part.Anchored = not part.Anchored
-- ブロックの視覚状態を更新
updateVisuals()
end
-- 更新して、クリックのリスニングを開始
updateVisuals()
cd.MouseClick:Connect(onToggle)

AssemblyAngularVelocity
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.AssemblyAngularVelocity:Vector3

AssemblyCenterOfMass
読み取り専用
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.AssemblyCenterOfMass:Vector3

AssemblyLinearVelocity
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.AssemblyLinearVelocity:Vector3

AssemblyMass
読み取り専用
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.AssemblyMass:number

AssemblyRootPart
読み取り専用
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.AssemblyRootPart:BasePart

AudioCanCollide
並列読み取り
シミュレーションへのアクセス
BasePart.AudioCanCollide:boolean

BackParamA
非推奨

BackParamB
非推奨

BackSurface
並列読み取り
BasePart.BackSurface:Enum.SurfaceType

BackSurfaceInput
非推奨

BottomParamA
非推奨

BottomParamB
非推奨

BottomSurface
並列読み取り
BasePart.BottomSurface:Enum.SurfaceType

BottomSurfaceInput
非推奨

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

brickColor
非推奨

CanCollide
並列読み取り
シミュレーションへのアクセス
BasePart.CanCollide:boolean
コードサンプル
フェードドア
-- 高さのあるパーツ内のスクリプトに貼り付けてください
local part = script.Parent
local OPEN_TIME = 1
-- 現在ドアを開けることができますか?
local debounce = false
local function open()
part.CanCollide = false
part.Transparency = 0.7
part.BrickColor = BrickColor.new("黒")
end
local function close()
part.CanCollide = true
part.Transparency = 0
part.BrickColor = BrickColor.new("明るい青")
end
local function onTouch(otherPart)
-- ドアがすでに開いている場合は何もしない
if debounce then
print("D")
return
end
-- Humanoidに触れたか確認
local human = otherPart.Parent:FindFirstChildOfClass("Humanoid")
if not human then
print("ヒューマノイドではありません")
return
end
-- ドアの開閉シーケンスを実行
debounce = true
open()
task.wait(OPEN_TIME)
close()
debounce = false
end
part.Touched:Connect(onTouch)
close()

CanQuery
並列読み取り
シミュレーションへのアクセス
BasePart.CanQuery:boolean

CanTouch
並列読み取り
シミュレーションへのアクセス
BasePart.CanTouch:boolean

CastShadow
並列読み取り
BasePart.CastShadow:boolean

CenterOfMass
読み取り専用
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.CenterOfMass:Vector3

CFrame
並列読み取り
シミュレーションへのアクセス
BasePart.CFrame:CFrame
コードサンプル
パートのCFrameを設定
local part = script.Parent:WaitForChild("Part")
local otherPart = script.Parent:WaitForChild("OtherPart")
-- パートのCFrameを(0, 0, 0)にリセット(回転なし)。
-- これは時々「恒等」CFrameと呼ばれます
part.CFrame = CFrame.new()
-- 特定の位置(X, Y, Z)に設定
part.CFrame = CFrame.new(0, 25, 10)
-- 上記と同じですが、Vector3を使用
local point = Vector3.new(0, 25, 10)
part.CFrame = CFrame.new(point)
-- パートのCFrameを一つの点に設定し、別の点を見つめる
local lookAtPoint = Vector3.new(0, 20, 15)
part.CFrame = CFrame.lookAt(point, lookAtPoint)
-- パートのCFrameをローカルX軸でpi/2ラジアン回転
part.CFrame = part.CFrame * CFrame.Angles(math.pi / 2, 0, 0)
-- パートのCFrameをローカルY軸で45度回転
part.CFrame = part.CFrame * CFrame.Angles(0, math.rad(45), 0)
-- グローバルZ軸でパートのCFrameを180度回転(順番に注意!)
part.CFrame = CFrame.Angles(0, 0, math.pi) * part.CFrame -- Piラジアンは180度に等しい
-- 二つのCFrameを構成するのは*(乗算演算子)を使用します
part.CFrame = CFrame.new(2, 3, 4) * CFrame.new(4, 5, 6) --> CFrame.new(6, 8, 10)に等しい
-- 代数の乗算とは異なり、CFrameの合成はコミュニケイティブではありません:a * bは必ずしもb * aではありません!
-- *を秩序のある一連のアクションとして想像してください。例えば、以下の行は異なるCFrameを生成します:
-- 1) パートをX方向に5ユニットスライド。
-- 2) パートをY軸周りに45度回転。
part.CFrame = CFrame.new(5, 0, 0) * CFrame.Angles(0, math.rad(45), 0)
-- 1) パートをY軸周りに45度回転。
-- 2) パートをX方向に5ユニットスライド。
part.CFrame = CFrame.Angles(0, math.rad(45), 0) * CFrame.new(5, 0, 0)
-- 「CFrame除算」はありませんが、単に「逆の操作を行う」だけです。
part.CFrame = CFrame.new(4, 5, 6) * CFrame.new(4, 5, 6):Inverse() --> CFrame.new(0, 0, 0)に等しい
part.CFrame = CFrame.Angles(0, 0, math.pi) * CFrame.Angles(0, 0, math.pi):Inverse() --> CFrame.Angles(0, 0, 0)に等しい
-- 他のパートに対して相対的にパートを配置(この場合、私たちのパートをotherPartの上に置く)
part.CFrame = otherPart.CFrame * CFrame.new(0, part.Size.Y / 2 + otherPart.Size.Y / 2, 0)

CollisionGroup
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.CollisionGroup:string
コードサンプル
PhysicsService:RegisterCollisionGroup
local PhysicsService = game:GetService("PhysicsService")
local collisionGroupBall = "CollisionGroupBall"
local collisionGroupDoor = "CollisionGroupDoor"
-- 衝突グループを登録します
PhysicsService:RegisterCollisionGroup(collisionGroupBall)
PhysicsService:RegisterCollisionGroup(collisionGroupDoor)
-- 部品を衝突グループに割り当てます
script.Parent.BallPart.CollisionGroup = collisionGroupBall
script.Parent.DoorPart.CollisionGroup = collisionGroupDoor
-- グループを互いに非衝突に設定し、結果を確認します
PhysicsService:CollisionGroupSetCollidable(collisionGroupBall, collisionGroupDoor, false)
print(PhysicsService:CollisionGroupsAreCollidable(collisionGroupBall, collisionGroupDoor)) --> false

CollisionGroupId
非推奨

Color
複製されていません
並列読み取り
BasePart.Color:Color3
コードサンプル
キャラクターの健康状態に基づく体の色
-- StarterCharacterScripts内のスクリプトに貼り付けてください
-- その後、ゲームをプレイし、キャラクターの健康状態をいじってみてください
local char = script.Parent
local human = char.Humanoid
local colorHealthy = Color3.new(0.4, 1, 0.2)
local colorUnhealthy = Color3.new(1, 0.4, 0.2)
local function setColor(color)
for _, child in pairs(char:GetChildren()) do
if child:IsA("BasePart") then
child.Color = color
while child:FindFirstChildOfClass("Decal") do
child:FindFirstChildOfClass("Decal"):Destroy()
end
elseif child:IsA("Accessory") then
child.Handle.Color = color
local mesh = child.Handle:FindFirstChildOfClass("SpecialMesh")
if mesh then
mesh.TextureId = ""
end
elseif child:IsA("Shirt") or child:IsA("Pants") then
child:Destroy()
end
end
end
local function update()
local percentage = human.Health / human.MaxHealth
-- 健康の割合に基づいて補間することで、色を作成
-- 色は colorHealthy (100%) ----- > colorUnhealthy (0%) に変わります
local color = Color3.new(
colorHealthy.R * percentage + colorUnhealthy.r * (1 - percentage),
colorHealthy.G * percentage + colorUnhealthy.g * (1 - percentage),
colorHealthy.B * percentage + colorUnhealthy.b * (1 - percentage)
)
setColor(color)
end
update()
human.HealthChanged:Connect(update)

CurrentPhysicalProperties
読み取り専用
複製されていません
並列読み取り
BasePart.CurrentPhysicalProperties:PhysicalProperties

CustomPhysicalProperties
並列読み取り
シミュレーションへのアクセス
BasePart.CustomPhysicalProperties:PhysicalProperties
コードサンプル
カスタム物理プロパティの設定
local part = script.Parent
-- これにより、部品が軽くてバウンドします!
local DENSITY = 0.3
local FRICTION = 0.1
local ELASTICITY = 1
local FRICTION_WEIGHT = 1
local ELASTICITY_WEIGHT = 1
local physProperties = PhysicalProperties.new(DENSITY, FRICTION, ELASTICITY, FRICTION_WEIGHT, ELASTICITY_WEIGHT)
part.CustomPhysicalProperties = physProperties

Elasticity
非推奨

EnableFluidForces
並列読み取り
シミュレーションへのアクセス
BasePart.EnableFluidForces:boolean

ExtentsCFrame
読み取り専用
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.ExtentsCFrame:CFrame

ExtentsSize
読み取り専用
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.ExtentsSize:Vector3

Friction
非推奨

FrontParamA
非推奨

FrontParamB
非推奨

FrontSurface
並列読み取り
BasePart.FrontSurface:Enum.SurfaceType

FrontSurfaceInput
非推奨

LeftParamA
非推奨

LeftParamB
非推奨

LeftSurface
並列読み取り
BasePart.LeftSurface:Enum.SurfaceType

LeftSurfaceInput
非推奨

LocalTransparencyModifier
非表示
複製されていません
並列読み取り
BasePart.LocalTransparencyModifier:number

Locked
並列読み取り
シミュレーションへのアクセス
BasePart.Locked:boolean
コードサンプル
再帰的アンロック
-- アンロックしたいモデル内のスクリプトに貼り付けてください
local model = script.Parent
-- この関数はモデルの階層を再帰的に辿って
-- 出会ったすべてのパーツをアンロックします。
local function recursiveUnlock(object)
if object:IsA("BasePart") then
object.Locked = false
end
-- オブジェクトの子供に同じ関数を呼び出します
-- オブジェクトに子供がいない場合、再帰プロセスは停止します
for _, child in pairs(object:GetChildren()) do
recursiveUnlock(child)
end
end
recursiveUnlock(model)

Mass
読み取り専用
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.Mass:number

Massless
並列読み取り
シミュレーションへのアクセス
BasePart.Massless:boolean

Material
並列読み取り
シミュレーションへのアクセス
BasePart.Material:Enum.Material

MaterialVariant
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.MaterialVariant:string

Orientation
非表示
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.Orientation:Vector3
コードサンプル
パーツスピナー
local part = script.Parent
local INCREMENT = 360 / 20
-- パーツを継続的に回転させる
while true do
for degrees = 0, 360, INCREMENT do
-- Y軸の回転のみを設定する
part.Rotation = Vector3.new(0, degrees, 0)
-- これを行うより良い方法はCFrameを設定することです
--part.CFrame = CFrame.new(part.Position) * CFrame.Angles(0, math.rad(degrees), 0)
task.wait()
end
end

PivotOffset
並列読み取り
シミュレーションへのアクセス
BasePart.PivotOffset:CFrame
コードサンプル
ピボットをリセット
local function resetPivot(model)
local boundsCFrame = model:GetBoundingBox()
if model.PrimaryPart then
model.PrimaryPart.PivotOffset = model.PrimaryPart.CFrame:ToObjectSpace(boundsCFrame)
else
model.WorldPivot = boundsCFrame
end
end
resetPivot(script.Parent)
時計の針
local function createHand(length, width, yOffset)
local part = Instance.new("Part")
part.Size = Vector3.new(width, 0.1, length)
part.Material = Enum.Material.Neon
part.PivotOffset = CFrame.new(0, -(yOffset + 0.1), length / 2)
part.Anchored = true
part.Parent = workspace
return part
end
local function positionHand(hand, fraction)
hand:PivotTo(CFrame.fromEulerAnglesXYZ(0, -fraction * 2 * math.pi, 0))
end
-- ダイヤルを作成
for i = 0, 11 do
local dialPart = Instance.new("Part")
dialPart.Size = Vector3.new(0.2, 0.2, 1)
dialPart.TopSurface = Enum.SurfaceType.Smooth
if i == 0 then
dialPart.Size = Vector3.new(0.2, 0.2, 2)
dialPart.Color = Color3.new(1, 0, 0)
end
dialPart.PivotOffset = CFrame.new(0, -0.1, 10.5)
dialPart.Anchored = true
dialPart:PivotTo(CFrame.fromEulerAnglesXYZ(0, (i / 12) * 2 * math.pi, 0))
dialPart.Parent = workspace
end
-- 針を作成
local hourHand = createHand(7, 1, 0)
local minuteHand = createHand(10, 0.6, 0.1)
local secondHand = createHand(11, 0.2, 0.2)
-- 時計を動かす
while true do
local components = os.date("*t")
positionHand(hourHand, (components.hour + components.min / 60) / 12)
positionHand(minuteHand, (components.min + components.sec / 60) / 60)
positionHand(secondHand, components.sec / 60)
task.wait()
end

Position
非表示
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.Position:Vector3

ReceiveAge
非表示
読み取り専用
複製されていません
並列読み取り
BasePart.ReceiveAge:number

Reflectance
並列読み取り
BasePart.Reflectance:number

ResizeableFaces
読み取り専用
複製されていません
並列読み取り
BasePart.ResizeableFaces:Faces
コードサンプル
リサイズハンドル
-- このスクリプトをさまざまな種類のBasePartに置いてください。
-- Part、TrussPart、WedgePart、CornerWedgePartなど。
local part = script.Parent
-- このパートのためにハンドルオブジェクトを作成します
local handles = Instance.new("Handles")
handles.Adornee = part
handles.Parent = part
-- このハンドルに適用可能な面を手動で指定します
handles.Faces = Faces.new(Enum.NormalId.Top, Enum.NormalId.Front, Enum.NormalId.Left)
-- あるいは、パートがリサイズ可能な面を使用します。
-- パートが長さ2のサイズの次元が2つのみのTrussPartである場合
-- ResizeableFacesは2つの有効な面しか持ちません。
-- 他のパーツの場合は、すべての面が有効になります。
handles.Faces = part.ResizeableFaces

ResizeIncrement
読み取り専用
複製されていません
並列読み取り
BasePart.ResizeIncrement:number

RightParamA
非推奨

RightParamB
非推奨

RightSurface
並列読み取り
BasePart.RightSurface:Enum.SurfaceType

RightSurfaceInput
非推奨

RootPriority
並列読み取り
BasePart.RootPriority:number

Rotation
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.Rotation:Vector3

RotVelocity
非推奨

Size
複製されていません
並列読み取り
シミュレーションへのアクセス
BasePart.Size:Vector3
コードサンプル
ピラミッドビルダー
local TOWER_BASE_SIZE = 30
local position = Vector3.new(50, 50, 50)
local hue = math.random()
local color0 = Color3.fromHSV(hue, 1, 1)
local color1 = Color3.fromHSV((hue + 0.35) % 1, 1, 1)
local model = Instance.new("Model")
model.Name = "Tower"
for i = TOWER_BASE_SIZE, 1, -2 do
local part = Instance.new("Part")
part.Size = Vector3.new(i, 2, i)
part.Position = position
part.Anchored = true
part.Parent = model
-- color0 と color1 の間でトゥイーンします
local perc = i / TOWER_BASE_SIZE
part.Color = Color3.new(
color0.R * perc + color1.R * (1 - perc),
color0.G * perc + color1.G * (1 - perc),
color0.B * perc + color1.B * (1 - perc)
)
position = position + Vector3.new(0, part.Size.Y, 0)
end
model.Parent = workspace

SpecificGravity
非推奨

TopParamA
非推奨

TopParamB
非推奨

TopSurface
並列読み取り
BasePart.TopSurface:Enum.SurfaceType

TopSurfaceInput
非推奨

Transparency
並列読み取り
BasePart.Transparency:number
コードサンプル
フェードドア
-- 高さのあるパーツ内のスクリプトに貼り付けてください
local part = script.Parent
local OPEN_TIME = 1
-- 現在ドアを開けることができますか?
local debounce = false
local function open()
part.CanCollide = false
part.Transparency = 0.7
part.BrickColor = BrickColor.new("黒")
end
local function close()
part.CanCollide = true
part.Transparency = 0
part.BrickColor = BrickColor.new("明るい青")
end
local function onTouch(otherPart)
-- ドアがすでに開いている場合は何もしない
if debounce then
print("D")
return
end
-- Humanoidに触れたか確認
local human = otherPart.Parent:FindFirstChildOfClass("Humanoid")
if not human then
print("ヒューマノイドではありません")
return
end
-- ドアの開閉シーケンスを実行
debounce = true
open()
task.wait(OPEN_TIME)
close()
debounce = false
end
part.Touched:Connect(onTouch)
close()

Velocity
非推奨

方法
AngularAccelerationToTorque
シミュレーションへのアクセス
BasePart:AngularAccelerationToTorque(
angAcceleration:Vector3, angVelocity:Vector3
パラメータ
angAcceleration:Vector3
angVelocity:Vector3
既定値: "0, 0, 0"
戻り値

ApplyAngularImpulse
シミュレーションへのアクセス
BasePart:ApplyAngularImpulse(impulse:Vector3):()
パラメータ
impulse:Vector3
戻り値
()

ApplyImpulse
シミュレーションへのアクセス
BasePart:ApplyImpulse(impulse:Vector3):()
パラメータ
impulse:Vector3
戻り値
()

ApplyImpulseAtPosition
シミュレーションへのアクセス
BasePart:ApplyImpulseAtPosition(
impulse:Vector3, position:Vector3
):()
パラメータ
impulse:Vector3
position:Vector3
戻り値
()

BreakJoints
非推奨

breakJoints
非推奨

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

CanSetNetworkOwnership
シミュレーションへのアクセス
BasePart:CanSetNetworkOwnership():Tuple
戻り値
コードサンプル
パーツのネットワーク所有権が設定可能かどうかを確認する
local part = workspace:FindFirstChild("Part")
if part and part:IsA("BasePart") then
local canSet, errorReason = part:CanSetNetworkOwnership()
if canSet then
print(part:GetFullName() .. "のネットワーク所有権は変更可能です!")
else
warn("ネットワーク所有権を変更できません: " .. part:GetFullName() .. " because: " .. errorReason)
end
end

GetClosestPointOnSurface
シミュレーションへのアクセス
BasePart:GetClosestPointOnSurface(position:Vector3):Vector3
パラメータ
position:Vector3
戻り値

GetConnectedParts
並列書き込み
BasePart:GetConnectedParts(recursive:boolean):{BasePart}
パラメータ
recursive:boolean
既定値: false
戻り値

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

GetMass
並列書き込み
シミュレーションへのアクセス
BasePart:GetMass():number
戻り値
コードサンプル
パーツの質量を探す
local myPart = Instance.new("Part")
myPart.Size = Vector3.new(4, 6, 4)
myPart.Anchored = true
myPart.Parent = workspace
local myMass = myPart:GetMass()
print("私のパーツの質量は " .. myMass)

getMass
非推奨

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

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

GetNoCollisionConstraints
シミュレーションへのアクセス
BasePart:GetNoCollisionConstraints():Instances
戻り値
Instances

GetRenderCFrame
非推奨

GetRootPart
非推奨

GetTouchingParts
シミュレーションへのアクセス
BasePart:GetTouchingParts():Instances
戻り値
Instances

GetVelocityAtPosition
並列書き込み
シミュレーションへのアクセス
BasePart:GetVelocityAtPosition(position:Vector3):Vector3
パラメータ
position:Vector3
戻り値

IntersectAsync
イールド
機能: CSG
BasePart:IntersectAsync(
parts:Instances, collisionfidelity:Enum.CollisionFidelity, renderFidelity:Enum.RenderFidelity
パラメータ
parts:Instances
collisionfidelity:Enum.CollisionFidelity
既定値: "Default"
renderFidelity:Enum.RenderFidelity
既定値: "Automatic"
戻り値

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

MakeJoints
非推奨

makeJoints
非推奨

Resize
シミュレーションへのアクセス
BasePart:Resize(
normalId:Enum.NormalId, deltaAmount:number
パラメータ
normalId:Enum.NormalId
deltaAmount:number
戻り値

resize
非推奨

SetNetworkOwner
シミュレーションへのアクセス
BasePart:SetNetworkOwner(playerInstance:Player):()
パラメータ
playerInstance:Player
既定値: "nil"
戻り値
()

SetNetworkOwnershipAuto
シミュレーションへのアクセス
BasePart:SetNetworkOwnershipAuto():()
戻り値
()

SubtractAsync
イールド
機能: CSG
BasePart:SubtractAsync(
parts:Instances, collisionfidelity:Enum.CollisionFidelity, renderFidelity:Enum.RenderFidelity
パラメータ
parts:Instances
collisionfidelity:Enum.CollisionFidelity
既定値: "Default"
renderFidelity:Enum.RenderFidelity
既定値: "Automatic"
戻り値
コードサンプル
BasePart:SubtractAsync()
local Workspace = game:GetService("Workspace")
local mainPart = script.Parent.PartA
local otherParts = { script.Parent.PartB, script.Parent.PartC }
-- 減算操作を実行
local success, newSubtract = pcall(function()
return mainPart:SubtractAsync(otherParts)
end)
-- 操作が成功した場合は、同じ場所に配置してワークスペースに親を設定します
if success and newSubtract then
newSubtract.Position = mainPart.Position
newSubtract.Parent = Workspace
end
-- 操作後も無傷の元のパーツを破壊します
mainPart:Destroy()
for _, part in otherParts do
part:Destroy()
end

TorqueToAngularAcceleration
シミュレーションへのアクセス
BasePart:TorqueToAngularAcceleration(
torque:Vector3, angVelocity:Vector3
パラメータ
torque:Vector3
angVelocity:Vector3
既定値: "0, 0, 0"
戻り値

UnionAsync
イールド
機能: CSG
BasePart:UnionAsync(
parts:Instances, collisionfidelity:Enum.CollisionFidelity, renderFidelity:Enum.RenderFidelity
パラメータ
parts:Instances
collisionfidelity:Enum.CollisionFidelity
既定値: "Default"
renderFidelity:Enum.RenderFidelity
既定値: "Automatic"
戻り値
コードサンプル
BasePart:UnionAsync()
local Workspace = game:GetService("Workspace")
local mainPart = script.Parent.PartA
local otherParts = { script.Parent.PartB, script.Parent.PartC }
-- ユニオン操作を実行します
local success, newUnion = pcall(function()
return mainPart:UnionAsync(otherParts)
end)
-- 操作が成功したら、同じ位置に配置し、ワークスペースに親を設定します
if success and newUnion then
newUnion.Position = mainPart.Position
newUnion.Parent = Workspace
end
-- 操作後も無傷の元のパーツを破壊します
mainPart:Destroy()
for _, part in otherParts do
part:Destroy()
end

イベント
LocalSimulationTouched
非推奨

OutfitChanged
非推奨

StoppedTouching
非推奨

Touched
BasePart.Touched(otherPart:BasePart):RBXScriptSignal
パラメータ
otherPart:BasePart
コードサンプル
接触している部品の数
local part = script.Parent
local billboardGui = Instance.new("BillboardGui")
billboardGui.Size = UDim2.new(0, 200, 0, 50)
billboardGui.Adornee = part
billboardGui.AlwaysOnTop = true
billboardGui.Parent = part
local tl = Instance.new("TextLabel")
tl.Size = UDim2.new(1, 0, 1, 0)
tl.BackgroundTransparency = 1
tl.Parent = billboardGui
local numTouchingParts = 0
local function onTouch(otherPart)
print("接触開始: " .. otherPart.Name)
numTouchingParts = numTouchingParts + 1
tl.Text = numTouchingParts
end
local function onTouchEnded(otherPart)
print("接触終了: " .. otherPart.Name)
numTouchingParts = numTouchingParts - 1
tl.Text = numTouchingParts
end
part.Touched:Connect(onTouch)
part.TouchEnded:Connect(onTouchEnded)
モデルが触れた
local model = script.Parent
local function onTouched(otherPart)
-- モデルのインスタンスが自身と接触するのを無視する
if otherPart:IsDescendantOf(model) then
return
end
print(model.Name .. "が" .. otherPart.Name .. "と衝突しました")
end
for _, child in pairs(model:GetChildren()) do
if child:IsA("BasePart") then
child.Touched:Connect(onTouched)
end
end

TouchEnded
BasePart.TouchEnded(otherPart:BasePart):RBXScriptSignal
パラメータ
otherPart:BasePart
コードサンプル
接触している部品の数
local part = script.Parent
local billboardGui = Instance.new("BillboardGui")
billboardGui.Size = UDim2.new(0, 200, 0, 50)
billboardGui.Adornee = part
billboardGui.AlwaysOnTop = true
billboardGui.Parent = part
local tl = Instance.new("TextLabel")
tl.Size = UDim2.new(1, 0, 1, 0)
tl.BackgroundTransparency = 1
tl.Parent = billboardGui
local numTouchingParts = 0
local function onTouch(otherPart)
print("接触開始: " .. otherPart.Name)
numTouchingParts = numTouchingParts + 1
tl.Text = numTouchingParts
end
local function onTouchEnded(otherPart)
print("接触終了: " .. otherPart.Name)
numTouchingParts = numTouchingParts - 1
tl.Text = numTouchingParts
end
part.Touched:Connect(onTouch)
part.TouchEnded:Connect(onTouchEnded)

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