Hi.
When developing a feature, I often need to visualize the data I’m working with, including Vector3
, CFrames
, paths, points, etc. One can use Adornments but usually, they require a lot of code to set up and aren’t as versatile IMHO. That’s why I’ve created Roblox Gizmos https://create.roblox.com/store/asset/109903121130716/Gizmos-Plugin
It is a free plugin that allows you to draw all sorts of shapes, points and paths easily from code, in any color, with a single function call like Gizmos:DrawCube(CFrame.new(1,2,3), Vector3.one)
.
With it, you can visualize whatever you need. For example, drawing the skeleton of a character becomes very easy with just a few lines of code.
Sample code
local Gizmos = require(game.ReplicatedStorage.Gizmos)
function Update(t, dt)
Gizmos:SetColor('white')
for _, des in script.Parent:GetDescendants() do
if des:IsA('Motor6D') then
local motor = des
local cf0, cf1 = motor.Part0.CFrame, motor.Part1.CFrame
local t = cf0 * motor.C0 * motor.Transform
Gizmos:DrawCube(cf1, Vector3.one*0.05)
Gizmos:DrawLine(cf0.Position, t.Position)
Gizmos:DrawLine(t.Position, cf1.Position)
Gizmos:DrawCFrame(t, 0.2)
end
end
end
game:GetService('RunService').PostSimulation:Connect(Update)
The Plugin Module uses a single WireframeHandleAdornment | Documentation - Roblox Creator Hub instance behind the scenes so it’s also quite performant.
I hope this can be helpful to some of you. If you have any feedback or suggestions just let me know. Thanks