요약
상속된 멤버
API 참조
속성
메서드
GetPivot
반환
코드 샘플
간단한 캐릭터 텔레포트
-- 이 코드는 StarterPlayerScripts 아래의 LocalScript에 배치되어야 합니다.
local Players = game:GetService("Players")
local ContextActionService = game:GetService("ContextActionService")
local player = Players.LocalPlayer
local function doTeleport(_actionName, inputState, _inputObject)
local character = player.Character
if character and character.Parent and inputState == Enum.UserInputState.Begin then
-- 캐릭터를 바라보는 방향으로 10 스탯만큼 이동시킵니다.
local currentPivot = character:GetPivot()
character:PivotTo(currentPivot * CFrame.new(0, 0, -10))
end
end
ContextActionService:BindAction("Teleport", doTeleport, true, Enum.KeyCode.F)PivotTo
매개 변수
반환
()
코드 샘플
간단한 캐릭터 텔레포트
-- 이 코드는 StarterPlayerScripts 아래의 LocalScript에 배치되어야 합니다.
local Players = game:GetService("Players")
local ContextActionService = game:GetService("ContextActionService")
local player = Players.LocalPlayer
local function doTeleport(_actionName, inputState, _inputObject)
local character = player.Character
if character and character.Parent and inputState == Enum.UserInputState.Begin then
-- 캐릭터를 바라보는 방향으로 10 스탯만큼 이동시킵니다.
local currentPivot = character:GetPivot()
character:PivotTo(currentPivot * CFrame.new(0, 0, -10))
end
end
ContextActionService:BindAction("Teleport", doTeleport, true, Enum.KeyCode.F)