Lớp công cụ
DataModelMesh
*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.
Tóm Tắt
Tài Liệu Tham Khảo API
Thuộc Tính
Offset
Mẫu mã
Độ lệch và tỷ lệ lưới
local TweenService = game:GetService("TweenService")
-- khởi tạo một phần và một lưới
local part = Instance.new("Part")
part.Size = Vector3.new(4, 8, 4)
part.Position = Vector3.new(0, 4, 0)
part.Anchored = true
part.CanCollide = false
local mesh = Instance.new("SpecialMesh")
mesh.MeshType = Enum.MeshType.FileMesh
mesh.MeshId = "rbxassetid://1086413449"
mesh.TextureId = "rbxassetid://1461576423"
mesh.Offset = Vector3.new(0, 0, 0)
mesh.Scale = Vector3.new(4, 4, 4)
mesh.Parent = part
-- hộp lựa chọn để hiển thị kích thước phần
local box = Instance.new("SelectionBox")
box.Adornee = part
box.Parent = part
-- thêm phần vào workspace
part.Parent = workspace
-- hoạt hình độ lệch và tỷ lệ với một tween
local tween = TweenService:Create(
mesh,
TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true, 0),
{ Scale = Vector3.new(1, 1, 1), Offset = Vector3.new(0, 3, 0) }
)
tween:Play()Scale
Mẫu mã
Độ lệch và tỷ lệ lưới
local TweenService = game:GetService("TweenService")
-- khởi tạo một phần và một lưới
local part = Instance.new("Part")
part.Size = Vector3.new(4, 8, 4)
part.Position = Vector3.new(0, 4, 0)
part.Anchored = true
part.CanCollide = false
local mesh = Instance.new("SpecialMesh")
mesh.MeshType = Enum.MeshType.FileMesh
mesh.MeshId = "rbxassetid://1086413449"
mesh.TextureId = "rbxassetid://1461576423"
mesh.Offset = Vector3.new(0, 0, 0)
mesh.Scale = Vector3.new(4, 4, 4)
mesh.Parent = part
-- hộp lựa chọn để hiển thị kích thước phần
local box = Instance.new("SelectionBox")
box.Adornee = part
box.Parent = part
-- thêm phần vào workspace
part.Parent = workspace
-- hoạt hình độ lệch và tỷ lệ với một tween
local tween = TweenService:Create(
mesh,
TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true, 0),
{ Scale = Vector3.new(1, 1, 1), Offset = Vector3.new(0, 3, 0) }
)
tween:Play()