WorldObject
μλμ λ°°μΉλ μ€λΈμ νΈμ 곡ν΅λ μμ±κ³Ό μ΄λ²€νΈ, ν¨μλ€μ΄μμ
μ΄λ²€νΈ
μμ± ν λ§€ νλ μλ§λ€ νΈμΆλλ μ΄λ²€νΈμμ.
μ°κ²°ν¨μ νμμ function(updateTime), updateTime μ number μ
λλ€.
-- μν --
Copy local cube = Workspace.Cube
local playTime = 0
local function UpdateEvent(updateTime) --OnUpdateEventλ‘ μ°κ²°λ ν¨μλ updateTime μΈμκ° κ³ μ μ μΌλ‘ λ€μ΄κ°μ.
playTime = playTime + updateTime --μκ°μ κΈ°λ‘ν΄μ.
end
cube.OnUpdateEvent:Connect(UpdateEvent) --Gameμ΄λ μ€λΈμ νΈμ λ§€νλ μλ§λ€ νΈμΆλλ ν¨μλ₯Ό μ°κ²°ν΄μ.
μμ λ λ νΈμΆλλ μ΄λ²€νΈμμ.
μ°κ²°ν¨μ νμμ function() μ
λλ€.
-- μν --
Copy local cube = Workspace.Cube
local function DestroyEvent()
print("Destroy!")
end
cube.OnDestroyEvent:Connect(DestroyEvent) --μ€λΈμ νΈμ ν΄λΉ μ€λΈμ νΈκ° νκ΄΄λμλ νΈμΆλλ ν¨μλ₯Ό μ°κ²°ν΄μ.
Game:DeleteObject(cube)
Enable λ λ νΈμΆλλ μ΄λ²€νΈμμ.
μ°κ²°ν¨μ νμμ function() μ
λλ€.
-- μν --
Copy local cube = Workspace.Cube
local function InitObj(self)
print("Enable")
end
cube.OnEnableEvent:Connect(InitObj) --ν΄λΉ μ€λΈμ νΈκ° Enableλ λ νΈμΆλλ ν¨μλ₯Ό μ°κ²°ν©λλ€.
wait(1)
cube.Enable = true
Disable λ λ νΈμΆλλ μ΄λ²€νΈμμ.
μ°κ²°ν¨μ νμμ function() μ
λλ€.
-- μν --
Copy local cube = Workspace.Cube
local function BackupToPoolList(self)
print("Disable")
end
cube.OnDisableEvent:Connect(BackupToPoolList) --ν΄λΉ μ€λΈμ νΈκ° Disableλ λ νΈμΆλλ ν¨μλ₯Ό μ°κ²°ν©λλ€.
wait(1)
cube.Enable = false
μμ±
κ°μ²΄ νμ±ν μ¬λΆ
-- μν --
Copy Workspace.Cube.Enable = false --μ€λΈμ νΈμ μνλ₯Ό λΉνμ±νν΄μ. (μμ μ€λΈμ νΈκ° μλ€λ©΄ μμλ€μ μνλ λͺ¨λ falseκ° λΌμ. λ¨, μΆ©λμμμλ μν₯μ΄ μμ΄μ.)
κ°μ²΄μ Matrix
-- μν --
Copy local cube = Workspace.Cube
local targetTransform = cube.Transform
targetTransform.Location = Vector.new(300, 0, 100)
targetTransform.Rotation = Vector.new(55, 100, 0)
cube.Transform = targetTransform --μ€λΈμ νΈλ₯Ό 보κ°μΌλ‘ μ΄λμμΌμ. (μΊλ¦ν°λ 보κ°μμ΄ μμ§μ¬μ.)
κ°μ²΄μ Local Transform
-- μν --
Copy local Cube = Workspace.Cube
print(Cube.LocalTransform)
local LocalTR = Workspace.SpawnPoint.LocalTransform
Cube.LocalTransform = LocalTR
κ°μ²΄μ μμΉ Vector
-- μν --
Copy local Cube = Workspace.Cube
Cube.Location = Vector.new(0, 300, 200)
κ°μ²΄μ λ‘컬μ’ν Vector
-- μν --
Copy local Cube = Workspace.Cube
Cube.LocalLocation = Vector.new(0, 300, 200)
κ°μ²΄μ νμ Vector
-- μν --
Copy local Cube = Workspace.Cube
Cube.Rotation = Vector.new(0, 100, 0)
κ°μ²΄μ λ‘컬 νμ Vector
-- μν --
Copy local Cube = Workspace.Cube
Cube.LocalRotation = Vector.new(0, 100, 0)
κ°μ²΄μ ν¬κΈ° Vector
-- μν --
Copy local Cube = Workspace.Cube
local scale = Cube.Scale --ν΄λΉ μ€λΈμ νΈμ ν¬κΈ°λ₯Ό 100μΌλ‘ λλ μ Vectorλ‘ λ°νν΄μ.(μλ₯Ό λ€μ΄ xκ°μ΄ 100μ΄λ©΄ 1λ‘ λ°νλΌμ.)
print(scale)
Cube.Scale = Vector.new(5, 5, 5) --μ€λΈμ νΈμ ν¬κΈ°λ₯Ό μ€μ ν΄μ.
κ°μ²΄μ κ°μμ±
-- μν --
Copy Workspace.Cube.Visible = false --μ€λΈμ νΈλ₯Ό 보μ΄μ§ μκ² ν΄μ.
ν¨μ
κ°μ²΄μ ν€ κ°μ μ»μ μ μμ΄μ.
-- μν --
Copy print(Workspace.Floor:GetKey())
void SetTransformWithCollisionCheck(bool CollisionCheck)
νμ¬ λ§€νΈλ¦μ€μμ μ€μ λ λ§€νΈλ¦μ€λ‘ 보κ°μ΄ λλ λ§€νΈλ¦μ€λ₯Ό μ€μ ν μ μμ΄μ μ€μ ν μ μμ΄μ. (Matrix κ°, bool μΆ©λ μ²λ¦¬ μ¬λΆ)
-- μν --
Copy local cube = Workspace.Cube
local targetTransform = cube.Transform
targetTransform.Location = Vector.new(300, 0, 100)
cube:SetTransformWithCollisionCheck(targetTransform, true) --μ€λΈμ νΈλ₯Ό 보κ°μΌλ‘ μ΄λμμΌμ. (μΊλ¦ν°λ 보κ°μμ΄ μμ§μ¬μ.)
void SetLocalTransformWithCollisionCheck(bool CollisionCheck)
νμ¬ λ§€νΈλ¦μ€μμ μ€μ λ λ§€νΈλ¦μ€λ‘ 보κ°μ΄ λλ λ§€νΈλ¦μ€λ₯Ό λ‘컬μ’νκΈ°μ€μΌλ‘ μ€μ ν μ μμ΄μ μ€μ ν μ μμ΄μ. (Matrix κ°, bool μΆ©λ μ²λ¦¬ μ¬λΆ)
-- μν --
Copy local cube = Workspace.Cube
local targetLocalTransform = cube.LocalTransform
targetLocalTransform.Location = Vector.new(300, 0, 100)
cube:SetLocalTransformWithCollisionCheck(targetLocalTransform, true) --μ€λΈμ νΈλ₯Ό 보κ°μΌλ‘ μ΄λμμΌμ. (μΊλ¦ν°λ 보κ°μμ΄ μμ§μ¬μ.)
μκ°μ΄λ νλ λ§€νΈλ¦μ€λ₯Ό μ€μ ν μ μμ΄μ. (Matrix κ°)
-- μν --
Copy local cube = Workspace.Cube
local targetTransform = cube.Transform
targetTransform.Location = Vector.new(0, 100, 0)
cube:Teleport(targetTransform) --μ€λΈμ νΈλ₯Ό 보κ°μμ΄ λ°λ‘ μ΄λμμΌμ.
void SetLocationWithCollisionCheck(Vector position, bool bCollisionCheck)
κ°μ²΄μ μμΉλ₯Ό μ€μ ν μ μμ΄μ. (μ€μ ν μμΉ Vector κ°, μΆ©λ μ²λ¦¬ μ¬λΆ)
-- μν --
Copy local Cube = Workspace.Cube
local targetLocation = Vector.new(0, 300, 200)
Cube:SetLocationWithCollisionCheck(targetLocation, true)
κ°μ²΄μ tagλ₯Ό μ€μ ν΄μ. (μ€μ ν tag)
-- μν --
Copy print(Workspace.Floor:GetTag())
Workspace.Floor:SetTag("SomeTag")
print(Workspace.Floor:GetTag())
κ°μ²΄μ μ€μ λ tagλ₯Ό μ»μ μ μμ΄μ.
-- μν --
Copy print(Workspace.Floor:GetTag())
Workspace.Floor:SetTag("SomeTag")
print(Workspace.Floor:GetTag())
void ConnectEventFunction(string customevent, function TargetFunction)
μ μ κ° μΆκ°ν μ€λΈμ νΈ μ»€μ€ν
μ΄λ²€νΈμ ν¨μλ₯Ό μ°κ²°ν μ μμ΄μ. (μ΄λ²€νΈ μ΄λ¦, μ°κ²° ν¨μ)
-- μν --
Copy --μλ² μ€ν¬λ¦½νΈμμ
local cube = Workspace.cube
--μλ²μμ μ΄λ²€νΈ μμ±μ 첫 μΈμλ‘ playerκ° λ€μ΄κ°μ.
local function ServerSomeFunc(player)
print("Call ServerSomeFunc")
end
cube:ConnectEventFunction("ServerSomeFunc", ServerSomeFunc) --μ€λΈμ νΈμ "ServerSomeFunc"λΌλ μ΄λ²€νΈ μ΄λ¦μΌλ‘ SomeFunc ν¨μλ₯Ό μ°κ²°ν΄μ.
--μ€λΈμ νΈκ° μλ Gameμλ μ°κ²°ν μ μμ΄μ.
--κ°μ λμμ λ±λ‘λ μ΄λ²€νΈλ§ νΈμΆν μ μμ΄μ.
--κ°μ μ΄λ¦μΌλ‘ μ¬λ¬ ν¨μλ₯Ό μ°κ²°ν μ μμ§λ§ μ΄ κ²½μ° νΈμΆν λ μ°κ²°λ ν¨μκ° λͺ¨λ νΈμΆλΌμ.
-----------------------------------
--ν΄λΌ μ€ν¬λ¦½νΈμμ
local cube = Workspace.cube
--ν΄λΌμμ μ΄λ²€νΈ μμ±μ player μΈμλ₯Ό μ°μ§ μμλ λΌμ.
local function ClientSomeFunc()
print("Call ClientSomeFunc")
end
cube:ConnectEventFunction("ClientSomeFunc", ClientSomeFunc)
void LookAt(vector location)
μ€λΈμ νΈκ° ν΄λΉνλ μμΉλ₯Ό λ°λΌλ³΄κ² ν μ μμ΄μ. (λ°λΌλ³Ό μμΉ Vector)
-- μν --
μ¬μ© κ°λ₯ν λΆλͺ¨ μ€λΈμ νΈ κΈ°λ₯λ€
μμ±
λΆλͺ¨ κ°μ²΄λ₯Ό μ»μ μ μμ΄μ.
κ°μ²΄μ μ΄λ¦μ
λλ€.
μ΄λ²€νΈ
ν¨μ
μΆκ°λ κ°μ΄ λ³κ²½ λ λ νΈμΆλλ μ΄λ²€νΈμμ. (Value μ΄λ¦, μ°κ²° ν¨μ)
μ΄λ¦μΌλ‘ μμ κ°μ²΄λ₯Ό μ»μ μ μμ΄μ. (μ°Ύκ³ μΆμ μμ κ°μ²΄ μ΄λ¦)
μμ κ°μ²΄μ 리μ€νΈλ₯Ό μ»μ μ μμ΄μ.
μΊλ¦ν°μΈμ§ νμΈν μ μμ΄μ.
μ€ν
ν± λ©μμΈμ§ νμΈν μ μμ΄μ.
FXμΈμ§ νμΈν μ μμ΄μ.
SoundμΈμ§ νμΈν μ μμ΄μ.
ν¬μΈνΈ λΌμ΄νΈμΈμ§ νμΈν μ μμ΄μ.
μ€ν¬νΈ λΌμ΄νΈμΈμ§ νμΈν μ μμ΄μ.
μνΌμ€ UIμΈμ§ νμΈν μ μμ΄μ.
μ€ν¬λ¦° UIμΈμ§ νμΈν μ μμ΄μ.
ν°μΉ UIμΈμ§ νμΈν μ μμ΄μ.
μμ΄ν
μΈμ§ νμΈν μ μμ΄μ.
NPCμΈμ§ νμΈν μ μμ΄μ.
μ€νΈλ¦½νΈμΈμ§ νμΈν μ μμ΄μ.
ColliderμΈμ§ νμΈν μ μμ΄μ.
WidgetμΈμ§ νμΈν μ μμ΄μ.
CameraμΈμ§ νμΈν μ μμ΄μ.
ν΄λΉ μ€λΈμ νΈκ° μ ν¨νμ§ νμΈ ν μμμ΄μ.
ν΄λΉ μ€λΈμ νΈμ κ°μ΄ μ ν¨νμ§ νμΈν μ μμ΄μ.