A PVInstance ("위치 속도 인스턴스")는 생성할 수 없는 추상 클래스입니다.세계에 물리적 위치가 있는 모든 개체의 기반, 특히 BaseParts 및 Models.
요약
메서드
PVInstance의 피벗을 가져옵니다.
피벗이 지금 지정된 PVInstance 에 위치하도록 모든 하위 요소 PVInstances 와 함께 변환하여 피벗이 지금 지정된 CFrame 에 위치합니다.
속성
메서드
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)