One of the most recent, but also most powerfull updates to Roblox Studio has dropped in the past couple days! I am talking about Introducing in-experience Mesh & Image APIs [Studio Beta]. So far there is no way to make a plugin with the latest APIs so that’s why I will show you what code you have to write to make your vertecis of an EditableMesh visible!
In order for any of that to work you will have to have the EditableMesh parented to a MeshPart.
Result:
In order to reach this goal you have to copy and paste the following code into your Command Bar!
Suggestions:
- Please adjust the first variable that will be set!
- Put your MeshPart into a Model, to move it around with all the markers for the vertecis!
- You can obviously adjust some of the code, which is responsible for the colors of the markers.
Code:
local EditableMesh = workspace.MeshPart.EditableMesh
local Ball = Instance.new("Part")
local InviBall = Instance.new("Part")
local Folder = EditableMesh.Parent:FindFirstChild("Vertecis")
local Beam = Instance.new("Beam")
local Attacment = Instance.new("Attachment")
if not Folder then
Folder = Instance.new("Folder")
Folder.Name = "Vertecis"
Folder.Parent = EditableMesh.Parent
else
for _,v in Folder:GetChildren() do
v:Destroy()
end
end
Beam.Color = ColorSequence.new(Color3.new(1, 1, 1))
Beam.FaceCamera = true
Beam.Width0 = 0.01
Beam.Width1 = 0.01
local InvAtt = Attacment:Clone()
InvAtt.Parent = InviBall
Ball.Size = Vector3.new(0.05,0.05,0.05)
Ball.Material = Enum.Material.Neon
Ball.Shape = "Ball"
Ball.Color = Color3.new(1, 0, 0)
Ball.Transparency = 0
Ball.Anchored = true
InviBall.Size = Vector3.new(0.01,0.01,0.01)
InviBall.Transparency = 1
InviBall.Anchored = true
local BillboardGui = Instance.new("BillboardGui")
BillboardGui.Parent = InviBall
BillboardGui.Name = "UI"
BillboardGui.Size = UDim2.new(0, 10, 0, 10)
local TextLabel = Instance.new("TextLabel")
TextLabel.Name = "Label"
TextLabel.Size = UDim2.new(1, 0, 1, 0)
TextLabel.BackgroundTransparency = 1
TextLabel.TextColor3 = Color3.new(0, 0, 0)
TextLabel.TextSize = 11
TextLabel.Text = "_"
TextLabel.Parent = BillboardGui
for i,v in EditableMesh:GetVertices() do
local NewBall = Ball:Clone()
NewBall.Position =EditableMesh:GetPosition(i) + EditableMesh.Parent.Position
NewBall.Parent = Folder
local NewInviBall = InviBall:Clone()
NewInviBall.Position = EditableMesh:GetPosition(i) + EditableMesh.Parent.Position + Vector3.new(0,3,0)
NewInviBall.UI.Label.Text = tostring(v)
NewInviBall.Parent = NewBall
local NewBeam = Beam:Clone()
NewBeam.Parent = NewBall
local NewAttachment = Attacment:Clone()
local NewAttachment1 = Attacment:Clone()
NewAttachment.Parent = NewBall
NewAttachment1.Parent = NewInviBall
NewBeam.Attachment0 = NewAttachment
NewBeam.Attachment1 = NewAttachment1
end
- Do you want/need a tutorial for making triangles visible?
0 voters
Good luck!