BasePart
BasePart : PVInstance
Overview
BasePart๋ Part, MeshPart ๋ฑ ๊ฒ์ ๊ณต๊ฐ(Workspace)์์ ์๊ฐ์ ์ผ๋ก ํ์๋๊ณ ๋ฌผ๋ฆฌ ์์ง์ ์ํฅ์ ๋ฐ๋ ๋ชจ๋ 3D ์ค๋ธ์ ํธ์ ๊ธฐ๋ณธ์ด ๋๋ ์ถ์ ํด๋์ค์ ๋๋ค.
๊ฐ๋ฐ ๋ฌธ์์์ "Part"๋ผ๋ ์ฉ์ด๊ฐ ์ฌ์ฉ๋ ๋๋, ํน์ ํ Part๋ง์ด ์๋๋ผ ๋๋ถ๋ถ BasePart ๊ณ์ด ๊ฐ์ฒด๋ฅผ ์๋ฏธํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง์ต๋๋ค.
BasePart๋ ๋ค์ํ ์์์ ๊ฒฐํฉํ์ฌ ๊ธฐ๋ฅ์ ํ์ฅํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, ์ฌ๋ฌ BasePart๋ฅผ ํ๋์ Model์ ๋ฌถ์ด ํจ๊ป ์ด๋์ํค๊ฑฐ๋, SurfaceGui๋ฅผ ์ด์ฉํ UI ํ์, PointLight๋ฅผ ํตํ ์กฐ๋ช , ParticleEmitter๋ Beam ๊ฐ์ VFX ์ถ๊ฐ๋ ๊ฐ๋ฅํฉ๋๋ค.
๋ฌผ๋ฆฌ ์ฅ์น(Constraint)์ ๊ฒฐํฉํ์ฌ ์ํธ์์ฉ์ ๊ตฌํํ ์๋ ์์ผ๋ฉฐ, LinearVelocity, AngularVelocity ๋ฑ๊ณผ ํจ๊ป ๋ฌผ๋ฆฌ์ ์์ง์์ ์ ์ดํ ์ ์์ต๋๋ค.
๋ํ BasePart๊ฐ Tool์ ํ์ ๊ฐ์ฒด์ด๋ฉฐ ์ด๋ฆ์ด "Handle"์ผ ๊ฒฝ์ฐ, ์บ๋ฆญํฐ๊ฐ ์์ ๋ค ์ ์์ต๋๋ค.
Properties
CFrame
CFrame
CFrame์ ์๋ ์ขํ๊ณ์์ BasePart์ ์์น์ ํ์ ์ ์ ์ํ๋ ์์ฑ์ผ๋ก, Position ์์ฑ๊ณผ ๋ฌ๋ฆฌ ํ์ ๊ณผ ๋ฐฉํฅ๊น์ง ํ ๋ฒ์ ์ง์ ํ ์ ์์ต๋๋ค.
๋ํ ํํธ์ ์์์ผ๋ก Attachment๋ฅผ ์ถ๊ฐํ๋ฉด, ํด๋น ํํธ๋ฅผ ๊ธฐ์ค์ผ๋ก ํ ์๋ ์์น๋ฅผ ์ถ์ ํ๋ ๋ฐ ํ์ฉํ ์ ์์ต๋๋ค.
Code Samples
local Part = script.Parent
-- Position
Part.CFrame = CFrame.new(200, 50, 300)
-- Angle
local Rotation = CFrame.Angles(0, 0, 30)
Part.CFrame = Part.CFrame * Rotation
-- Position & Angle
Part.CFrame = CFrame.new(200, 50, 300) * CFrame.Angles(0, 40, 0)
-- LookAt
local TargetPosition = Vector3.new(0, 30, 0)
Part.CFrame = CFrame.lookAt(Part.Position, TargetPosition)
Anchored
bool
ํํธ๊ฐ ๋ฌผ๋ฆฌ์ ์ธ ํ์ ์ํด ์์ง์ผ ์ ์๋์ง๋ฅผ ๊ฒฐ์ ํ๋ ์์ฑ์ ๋๋ค.
์ด ๊ฐ์ด true์ด๋ฉด ํด๋น ํํธ๋ ์ค๋ ฅ์ด๋ ์ถฉ๋ ๋ฑ ๋ฌผ๋ฆฌ ์์ง์ ์ํฅ์ ๋ฐ์๋ ์์น์ ํ์ ์ด ๋ณํ์ง ์์ต๋๋ค. ๋ค๋ง, ์คํฌ๋ฆฝํธ๋ฅผ ํตํด Position ๋๋ CFrame ๊ฐ์ ์ง์ ์์ ํ๋ฉด ์ด๋ํ ์ ์์ต๋๋ค.
ํํธ๋ฅผ ๋ฐฐ์นํ๋ฉด Anchored ์์ฑ์ ๊ธฐ๋ณธ๊ฐ์ด true๋ก ์ค์ ๋์ด ๊ณ ์ ๋ ์ํ๊ฐ ๋ฉ๋๋ค. ์ด๋ ๋ถํ์ํ ๋ฌผ๋ฆฌ ์ฐ์ฐ์ ๋ฐฉ์งํด ์ฑ๋ฅ์ ํฅ์์ํค๊ธฐ ์ํ ๊ฒ์ด๋ฏ๋ก, ๋ฐฐ์นํ ํํธ๊ฐ ๋ฌผ๋ฆฌ์ ์ํฅ์ ๋ฐ์ง ์๋ ๊ฒฝ์ฐ ๊ฐ์ฅ ๋จผ์ ์ด ์์ฑ์ ํ์ธํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
Code Samples
local Part = script.Parent
Part.Anchored = false
CanCollide
bool
ํํธ๊ฐ ๋ค๋ฅธ ๊ฐ์ฒด์ ์ถฉ๋ ์ ํต๊ณผ ๊ฐ๋ฅํ์ง๋ฅผ ๊ฒฐ์ ํ๋ ์์ฑ์ ๋๋ค.
์ด ๊ฐ์ด false์ด๋ฉด ๋ค๋ฅธ ํํธ๋ ์บ๋ฆญํฐ๊ฐ ํด๋น ํํธ๋ฅผ ์์ ๋กญ๊ฒ ํต๊ณผํ ์ ์์ต๋๋ค. ๊ฒ์ ๋ด์์ ๋จ์ ์ฅ์์ฉ์ผ๋ก ๋ฐฐ์น๋ ์ค๋ธ์ ํธ๋ ๋ฌผ๋ฆฌ ์ฐ์ฐ์ด ๋ถํ์ํ๋ฏ๋ก, ์ฑ๋ฅ ํฅ์์ ์ํด CanCollide๋ฅผ ๋นํ์ฑํํ๋ ๊ฒ์ด ๊ถ์ฅ๋ฉ๋๋ค.
๋ํ ์ถฉ๋์ด ๋นํ์ฑํ๋์ด๋ Touched ์ด๋ฒคํธ๋ ๊ณ์ ๋ฐ์ํ ์ ์์ต๋๋ค. ์ด ๊ฒฝ์ฐ CanTouch ์์ฑ์ false๋ก ์ค์ ํ๋ฉด ์ด๋ฒคํธ ๋ฐ์์ ์ฐจ๋จํ ์ ์์ต๋๋ค.
Code Samples
local Part = script.Parent
Part.CanCollide = false
CanQuery
bool
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
CanTouch
bool
ํด๋น ํํธ๊ฐ Touched, TouchEnded์ ๊ฐ์ ํฐ์น ์ด๋ฒคํธ๋ฅผ ๋ฐ์์ํฌ ์ ์๋์ง๋ฅผ ๊ฒฐ์ ํ๋ ์์ฑ์ ๋๋ค.
CanTouch์ CanCollide๋ฅผ ๋ชจ๋ false๋ก ์ค์ ํ๋ฉด ํํธ ๊ฐ ์ถฉ๋ ์ฐ์ฐ์ด ์๋ต๋์ด ์ฑ๋ฅ์ด ํฅ์๋ฉ๋๋ค. ๋จ, ์ด ๊ฒฝ์ฐ์๋ Raycast๋ฅผ ํตํ ๊ฐ์ง๋ ์ฌ์ ํ ๊ฐ๋ฅํฉ๋๋ค.
Code Samples
local Part = script.Parent
local function OnTouched(otherPart)
print(Part.Name, "Touched :", otherPart.Name)
end
Part.Touched:Connect(OnTouched)
Part.CanTouch = false
Size
Vector3
ํํธ์ ๊ฐ๋กยท์ธ๋กยท๋์ด ํฌ๊ธฐ๋ฅผ ์ค์ ํ๋ ์์ฑ์ ๋๋ค.
Code Samples
local Part = script.Parent
Part.Size = Vector3.new(50, 50, 50)
AssemblyAngularVelocity
Vector3
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
AssemblyCenterOfMass
Vector3
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
AssemblyLinearVelocity
Vector3
ํด๋น ํํธ๊ฐ ์ํ ์ด์ ๋ธ๋ฆฌ์ ์ง๋ ์ค์ฌ์์์ ์ ํ ์๋๋ฅผ ๋ํ๋ด๋ ์์ฑ์ ๋๋ค.
์ด ๊ฐ์ ์ง์ ๋ณ๊ฒฝํ๋ฉด ๋ฌผ๋ฆฌ์ ์ผ๋ก ๋ถ์์ฐ์ค๋ฌ์ด ์์ง์์ด ๋ฐ์ํ ์ ์์ผ๋ฏ๋ก, ์ง์์ ์ธ ์๋ ์ ์ด๊ฐ ํ์ํ๋ค๋ฉด VectorForce ์ธ์คํด์ค๋ฅผ, ์๊ฐ์ ์ธ ์๋ ๋ณํ๊ฐ ํ์ํ๋ค๋ฉด ApplyImpulse() ํจ์๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ๊ถ์ฅ๋ฉ๋๋ค.
Code Samples
local Part = script.Parent
print(Part.AssemblyLinearVelocity)
AssemblyMass
number
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
BrickColor
BrickColor
ํํธ์ ๊ธฐ๋ณธ ์์์ ์ง์ ํ๋ ์์ฑ์ผ๋ก, ์ค์ ๋ Material์ ์ง๊ฐ์ ์์์ด ํจ๊ป ์ ์ฉ๋ฉ๋๋ค.
์ฌ์ ์ ์ ์๋ ์์์ ๋น ๋ฅด๊ฒ ์ ํํ ์ ์๋๋ก ์ ๊ณต๋๋ฉฐ, ๋ ์ ๋ฐํ ์์ ์กฐ์ ์ด ํ์ํ๋ค๋ฉด Color ์์ฑ์ ์ง์ ์ค์ ํ ์ ์์ต๋๋ค. ์ด ๊ฒฝ์ฐ ํด๋น ๊ฐ๊ณผ ๊ฐ์ฅ ์ ์ฌํ BrickColor๊ฐ ์๋์ผ๋ก ์ ์ฉ๋ฉ๋๋ค.
Code Samples
local Part = script.Parent
Part.BrickColor = BrickColor.new("Really red")
if Part.BrickColor.Name == "Really red" then
print("Red!")
end
CastShadow
bool
ํด๋น ํํธ์ ๊ทธ๋ฆผ์๋ฅผ ์์ฑํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ ํ๋ ์์ฑ์ผ๋ก, ์ฑ๋ฅ ์ต์ ํ๋ฅผ ์ํด ๊ธฐ๋ณธ๊ฐ์ false์ด๋ฉฐ ํ์ํ ๊ฒฝ์ฐ์๋ง ํ์ฑํํ๋ ๊ฒ์ด ๊ถ์ฅ๋ฉ๋๋ค.
๊ทธ๋ฆผ์ ๋ณต์ก๋๋ Lighting ์๋น์ค๋ฅผ ์ ํํ ๋ค, ํ๋กํผํฐ ํจ๋์์ Shadow Detail Level ๊ฐ์ ์กฐ์ ํ์ฌ ์ ์ฒด ํํธ์ ๊ทธ๋ฆผ์ ํ์ง์ ์ง์ ํ ์ ์์ต๋๋ค.
๋ํ, ํน์ ํํธ๋ฅผ ์ ํํ ํ ํ๋กํผํฐ ํจ๋์์ Enable Mesh Shadow Details๋ฅผ ํ์ฑํํ๋ฉด ๊ฐ๋ณ ๋ฉ์ ๋จ์๋ก Mesh Shadow Detail Level์ ์ค์ ํ ์ ์์ผ๋ฉฐ, ์ด ๊ฒฝ์ฐ Lighting ์๋น์ค์ ์ ์ญ ์ค์ ๋ณด๋ค ํด๋น ๋ฉ์์ ์ค์ ์ด ์ฐ์ ์ ์ฉ๋ฉ๋๋ค.
๊ทธ๋ฆผ์ ๋ณต์ก๋ ๊ด๋ จ ์ค์ ์ ๋ฐํ์์์ ๋ณ๊ฒฝํ ์ ์์ต๋๋ค.
Code Samples
local Part = script.Parent
print(Part.CastShadow)
CenterOfMass
Vector3
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
CollisionGroup
string
ํํธ๋ฅผ ํน์ ์ถฉ๋ ๊ทธ๋ฃน์ ์ง์ ํ๋ ์์ฑ์ผ๋ก, ์๋ก ์์ฑ๋ ํํธ๋ ๊ธฐ๋ณธ์ ์ผ๋ก Default ๊ทธ๋ฃน์ ์ํ๋ฉฐ ๋น ๋ฌธ์์ด์ ํ์ฉ๋์ง ์์ต๋๋ค.
์ถฉ๋ ๊ทธ๋ฃน ๊ฐ์๋ ์ถฉ๋ ์ฌ๋ถ๋ฅผ ๊ฐ๋ณ์ ์ผ๋ก ์ค์ ํ ์ ์์ผ๋ฉฐ, ์ด๋ฅผ ํตํด ํน์ ํํธ๋ผ๋ฆฌ๋ง ๋ถ๋ชํ๊ฑฐ๋ ์๋ก๋ฅผ ํต๊ณผํ๋๋ก ์ ์ดํ ์ ์์ต๋๋ค. ์ด ์ค์ ์ ์ฃผ๋ก ๊ฒ์ ๋ด์์ ์ค๋ธ์ ํธ ๊ฐ์ ์ํธ์์ฉ ๋ฒ์๋ฅผ ์ธ๋ถํํ๊ฑฐ๋, ๋ถํ์ํ ๋ฌผ๋ฆฌ ์ฐ์ฐ์ ์ค์ฌ ์ฑ๋ฅ์ ์ต์ ํํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค.
Code Samples
local Part = script.Parent
local PhysicsService = game:GetService("PhysicsService")
local DefaultGroup = "Default"
local FallGroup = "Fall"
PhysicsService:RegisterCollisionGroup(FallGroup)
wait(2)
PhysicsService:CollisionGroupSetCollidable(DefaultGroup, FallGroup, false)
Part.CollisionGroup = FallGroup
Color
Color3
ํํธ์ ๊ธฐ๋ณธ ์์์ ์ง์ ํ๋ ์์ฑ์ผ๋ก, ์ค์ ๋ Material์ ์ง๊ฐ์ ์์์ด ํจ๊ป ์ ์ฉ๋ฉ๋๋ค.
์ด ๊ฐ์ ๋ณ๊ฒฝํ๋ฉด BrickColor ์์ฑ์ด ์ด์ ๋ง์ถฐ ๊ฐ์ฅ ์ ์ฌํ ์์์ผ๋ก ์๋ ๋ณ๊ฒฝ๋ฉ๋๋ค.
BrickColor ์์ฑ์ด ์ฌ์ ์ ์ ์๋ ์์ ์ค์์ ์ ํํ๋ ๋ฐฉ์์ด๋ผ๋ฉด, Color๋ ์ค์ ๊ฐ์ด๋ RGB๋ฅผ ํตํด ์์์ ์ง์ ์ง์ ํ ๋ ์ฌ์ฉ๋ฉ๋๋ค.
Code Samples
local Part = script.Parent
wait(2)
Part.Color = Color3.new(0, 0, 1) -- Blue
wait(2)
Part.Color = Color3.fromRGB(255, 0, 0) -- Red
CurrentPhysicalProperties
PhysicalProperties
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
CustomPhysicalProperties
PhysicalProperties
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
ExtentsCFrame
CFrame
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
ExtentsSize
Vector3
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
LocalTransparencyModifier
number
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
Locked
bool
์คํ๋์ค ํธ์ง ๋ชจ๋์์ ๋ทฐํฌํธ ๋ด ํด๋น ํํธ๋ฅผ ๋ง์ฐ์ค๋ก ํด๋ฆญํด ์ ํํ ์ ์๋์ง ์ฌ๋ถ๋ฅผ ๊ฒฐ์ ํ๋ ์์ฑ์ ๋๋ค.
์ฃผ๋ก ๊ฑด๋ฌผ, ์งํ, ์ฅ์ ์์ ๋ฑ์ ๋ฐฐ์นํ ๋ค, ์๋์น ์์ ์์ ์ ๋ฐฉ์งํ๊ธฐ ์ํด ์ฌ์ฉ๋ฉ๋๋ค.
Code Samples
local Part = script.Parent
print(Part.Locked)
CanClimb
bool
์บ๋ฆญํฐ๊ฐ ํด๋น ํํธ๋ฅผ ๋ฑ๋ฐํ ์ ์๋์ง๋ฅผ ๊ฒฐ์ ํ๋ ์์ฑ์ ๋๋ค.
CanClimb์ด ํ์ฑํ๋ Part์ ์บ๋ฆญํฐ๊ฐ ๋ฟ์ผ๋ฉด Climbing ์ํ๋ก ์ ํ๋์ด ๋ฒฝ์ ์ค๋ฅผ ์ ์์ต๋๋ค. ๋จ, CanClimb์ด ์ผ์ ธ ์์ด๋ ์บ๋ฆญํฐ๊ฐ ๋ฐ๋ผ๋ณด๋ ๋ฒฝ์ ๊ฒฝ์ฌ๊ฐ GameSettings์ MaxSlopeAngle ๊ฐ๋ณด๋ค ์๋ค๋ฉด Climbing ์ํ๋ก ์ ํ๋์ง ์์ผ๋ฉฐ, ๋์ ๊ฒฝ์ฌ๋ฉด์ ๊ฑท๊ฑฐ๋ ๋ฐ์ด ์ด๋ํ๊ฒ ๋ฉ๋๋ค.
๊ธฐ๋ณธ๊ฐ์ false์ด๋ฏ๋ก, ์ฌ๋ค๋ฆฌ์ฒ๋ผ ๋ฑ๋ฐ์ด ํ์ํ ์ค๋ธ์ ํธ๋ ์ด ์์ฑ์ ํ์ฑํํด์ผ ํฉ๋๋ค.
Code Samples
Mass
number
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
Massless
bool
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
Material
Enum.Material
ํํธ์ ํ๋ฉด ์ง๊ฐ์ ์ค์ ํ๋ ์์ฑ์ ๋๋ค.
Material๊ณผ Color๋ฅผ ์ ์ ํ ์กฐํฉํ๋ฉด ๊ฒ์ ๋ด์์ ๋ค์ํ ๋ถ์๊ธฐ์ ์๊ฐ์ ํจ๊ณผ๋ฅผ ์ฐ์ถํ ์ ์์ต๋๋ค.
Code Samples
local Part = script.Parent
Part.Material = Enum.Material.StoneBrick
MaterialVariant
string
์ฌ์ ์ ์ ์๋ ๊ธฐ๋ณธ ๋จธํฐ๋ฆฌ์ผ์ ๋ณํํ MaterialVariant๋ฅผ ์ง์ ํ๋ ์์ฑ์ ๋๋ค.
์ ๋ ฅํ MaterialVariant ์ด๋ฆ์ด ์กด์ฌํ๋ฉด ํด๋น MaterialVariant๋ก ์ ์ฉ๋๋ฉฐ, ๋์์ ํด๋น MaterialVariant๊ฐ ์ํ ๊ธฐ๋ณธ ๋จธํฐ๋ฆฌ์ผ(Base Material)์ ๋ง์ถฐ Material ์์ฑ๋ ์๋์ผ๋ก ๋ณ๊ฒฝ๋ฉ๋๋ค.
Code Samples
local Part = script.Parent
print(Part.MaterialVariant)
Position
Vector3
์๋ ์ขํ๊ณ์์ ํํธ์ ์์น๋ฅผ ์ง์ ํ๋ ์์ฑ์ ๋๋ค.
CFrame์ ์์น ๊ฐ์ ๋ฐ์ํ๋ฉฐ, CFrame์ด๋ ์ด ์์ฑ์ ์ง์ ๋ณ๊ฒฝํ์ฌ ์์ ํ ์ ์์ต๋๋ค.
Code Samples
local Part = script.Parent
Part.Position = Vector3.new(0, 50, -500)
ReceiveAge
number
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
Reflectance
number
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
ResizeIncrement
number
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
RootPriority
number
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
Rotation
Vector3
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Code Samples
Orientation
Vector3
Vector3 ๊ฐ์ผ๋ก ํํธ์ X, Y, Z ์ถ ํ์ ์ ๋ ๋จ์๋ก ์ง์ ํ๋ ์์ฑ์ผ๋ก, ํ์ ์ Y, X, Z ์์๋ก ์ ์ฉ๋ฉ๋๋ค.
์ด ๋ฐฉ์์ ์ผ๋ฐ์ ์ธ ์ค์ผ๋ฌ ๊ฐ์ด ์๋ Tait-Bryan ๊ฐ์ ์ฌ์ฉํ๋ฉฐ, ์ด๋ ๊ฐ๊ฐ ์(yaw), ํผ์น(pitch), ๋กค(roll)์ ๋ํ๋ ๋๋ค.
CFrame.Angles() ์์ฑ์๋ Z, Y, X ์์ผ๋ก ํ์ ์ ์ ์ฉํ๋ฏ๋ก Orientation ์์ฑ๊ณผ ์๋ ๋ฐฉ์์ด ๋ค๋ฆ ๋๋ค. ๋ณด๋ค ์ ๋ฐํ ํ์ ์ ์ด๊ฐ ํ์ํ ๊ฒฝ์ฐ CFrame์ ์ง์ ์ค์ ํ๋ ๊ฒ์ด ๊ถ์ฅ๋ฉ๋๋ค.
Code Samples
local Part = script.Parent
### Transparency
`number`
ํํธ์ ํฌ๋ช
๋๋ฅผ ์ค์ ํ๋ ์์ฑ์ผ๋ก, ๊ฐ์ 0(์์ ๋ถํฌ๋ช
)๋ถํฐ 1(์์ ํฌ๋ช
)๊น์ง ์ง์ ํ ์ ์์ต๋๋ค.
๊ฐ์ด 1์ด๋ฉด ํํธ๋ ์ ํ ๋ ๋๋ง๋์ง ์์ผ๋ฉฐ, 0๋ณด๋ค ํฌ๊ณ 1๋ณด๋ค ์์ ๊ฒฝ์ฐ์๋ ๋ฐํฌ๋ช
์ํ๊ฐ ๋ฉ๋๋ค.
์์ ํ ํฌ๋ช
ํ ํํธ๋ ๋ ๋๋ง๋์ง ์์ ์ฑ๋ฅ ๋ถ๋ด์ด ์์ง๋ง, ๋ฐํฌ๋ช
ํํธ๋ GPU ์ฐ์ฐ์ด ์ถ๊ฐ๋ก ํ์ํด ๋ค์ ์ฌ์ฉ ์ ์ฑ๋ฅ ์ ํ๋ฅผ ์ ๋ฐํ ์ ์์ต๋๋ค. 
#### Code Samples
```lua
local Part = script.Parent
Part.Transparency = 0.5
Methods
ApplyImpulse
ํํธ์ ์๊ฐ์ ์ธ ๋ฌผ๋ฆฌ ํ์ ๊ฐํด ์ฆ์ ๊ฐ์์ํค๋ ๊ธฐ๋ฅ์ ์ํํฉ๋๋ค.
ํ์ ํญ์ ์ด์ ๋ธ๋ฆฌ์ ์ง๋ ์ค์ฌ์ ์ ์ฉ๋๋ฏ๋ก ํ์ ์ด ์๋ ์ง์ ์ด๋๋ง ๋ฐ์ํ๋ฉฐ, Anchored ์์ฑ์ด false์ธ ๊ฒฝ์ฐ์๋ง ๋์ํฉ๋๋ค.
Parameters
Vector3
impulse
์ ์ฉํ ์ ํ(์ง์ ) ๋ฌผ๋ฆฌ ์ํ์ค ๋ฒกํฐ์ ๋๋ค.
Return
void
Code Samples
local Part = script.Parent
local Force = Vector3.new(0, 0, -200000)
wait(2)
Part.Anchored = false
Part:ApplyImpulse(Force)
GetMass
ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
Parameters
Return
number
Code Samples
Events
TouchEnded
๋ ํํธ๊ฐ ์๋ก ๋ฟ์ ์๋ ์ํ์์ ์ ์ด์ด ํด์ ๋ ๋ ํธ์ถ๋ฉ๋๋ค.
๋ฐ์ ์กฐ๊ฑด์ Touched ์ด๋ฒคํธ์ ๊ฑฐ์ ๋์ผํ์ง๋ง, ์์ ์ด ์ ์ด ์์์ด ์๋ ์ ์ด ์ข ๋ฃ๋ผ๋ ์ ์ด ๋ค๋ฆ ๋๋ค.
๋ฌผ๋ฆฌ์ ์ธ ์ด๋๋ฟ ์๋๋ผ, ์คํฌ๋ฆฝํธ๋ก Position ๋๋ CFrame ๊ฐ์ ๋ณ๊ฒฝํ์ฌ ์ ์ด์ด ํด์ ๋ ๊ฒฝ์ฐ์๋ ํธ์ถ๋ฉ๋๋ค.
๋จ, ์๋ํฐ์์ ๋ฏธ๋ฆฌ ๊ฒน์ณ ๋ฐฐ์นํ ๊ฒฝ์ฐ์๋ ๋ฐ์ํ์ง ์์ผ๋ฉฐ, CanTouch ์์ฑ์ด ๋นํ์ฑํ๋์ด ์์ผ๋ฉด ์ด๋ฒคํธ๊ฐ ์คํ๋์ง ์์ต๋๋ค.
Parameters
BasePart
otherPart
์ด๋ฒคํธ๊ฐ ์ฐ๊ฒฐ๋ ํํธ์ ์ ์ด ํด์ ๋ ๋์ ํํธ์ ๋๋ค.
Code Samples
local Part = script.Parent
local function OnTouchEnded(otherPart)
print("[OnTouchEnded]", otherPart)
end
Part.TouchEnded:Connect(OnTouchEnded)
Touched
์ด๋ฒคํธ๊ฐ ์ฐ๊ฒฐ๋ ํํธ๊ฐ ๋ค๋ฅธ ํํธ์ ์ ์ดํ ๋ ์คํ๋ฉ๋๋ค.
๋ฌผ๋ฆฌ์ ์ธ ์ด๋๋ฟ ์๋๋ผ, ์คํฌ๋ฆฝํธ๋ก Position ๋๋ CFrame ๊ฐ์ ๋ณ๊ฒฝํ์ฌ ์ ์ด์ด ๋ฐ์ํ ๊ฒฝ์ฐ์๋ ํธ์ถ๋ฉ๋๋ค.
๋จ, ์๋ํฐ์์ ๋ฏธ๋ฆฌ ๊ฒน์ณ ๋ฐฐ์นํ ๊ฒฝ์ฐ์๋ ๋ฐ์ํ์ง ์์ผ๋ฉฐ, CanTouch ์์ฑ์ด ๋นํ์ฑํ๋์ด ์์ผ๋ฉด ์ด๋ฒคํธ๊ฐ ์คํ๋์ง ์์ต๋๋ค.
Parameters
BasePart
otherPart
์ด๋ฒคํธ๊ฐ ์ฐ๊ฒฐ๋ ํํธ์ ์ ์ดํ ๋์ ํํธ์ ๋๋ค.
Code Samples
local Part = script.Parent
local function OnTouched(otherPart)
print("[OnTouched]", otherPart)
end
Part.Touched:Connect(OnTouched)
Last updated