PVInstance

Hiển Thị Bản Đã Lỗi Thời

*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.

Không Thể Tạo
Không Thể Duyệt

Một PVInstance ("Vị trí tốc độ của ví dụ") là một lớp trừu tượng không thể tạo được.Nó là nền tảng cho tất cả các đối tượng có vị trí vật lý trên thế giới, cụ thể là BasePartsModels.

Tóm Tắt

Thuộc Tính

  • Không Sao Chép
    Không Thể Viết Kịch Bản
    Đọc Song Song
  • Không Sao Chép
    Không Thể Viết Kịch Bản
    Đọc Song Song

Phương Pháp

Thuộc Tính

Origin

Không Sao Chép
Không Thể Viết Kịch Bản
Đọc Song Song

Pivot Offset

Không Sao Chép
Không Thể Viết Kịch Bản
Đọc Song Song

Phương Pháp

GetPivot

Ghi Song Song

Lợi Nhuận

Mẫu mã

Simple Character Teleportation

-- This code should be placed in a LocalScript under StarterPlayerScripts
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
-- Move the character 10 studs forwards in the direction they're facing
local currentPivot = character:GetPivot()
character:PivotTo(currentPivot * CFrame.new(0, 0, -10))
end
end
ContextActionService:BindAction("Teleport", doTeleport, true, Enum.KeyCode.F)

PivotTo

()

Tham Số

targetCFrame: CFrame
Giá Trị Mặc Định: ""

Lợi Nhuận

()

Mẫu mã

Simple Character Teleportation

-- This code should be placed in a LocalScript under StarterPlayerScripts
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
-- Move the character 10 studs forwards in the direction they're facing
local currentPivot = character:GetPivot()
character:PivotTo(currentPivot * CFrame.new(0, 0, -10))
end
end
ContextActionService:BindAction("Teleport", doTeleport, true, Enum.KeyCode.F)

Sự Kiện