Rendering a line segment

Basically I want it to be where I give it a vector the vector is drawn x distance on each side. Here is a drawing of what I want. Now I know it cant go on forever but the line segment should extend x distance on each side

So far I’ve been basically rendering the vector and inversed vector with @starmaq module

Module to draw Vectors and CFrames

But right now I have to be constantly destroying and calling the Visualize() function. So is there like a neat cframe trick that does this? Given 2 points draw a line segment which extends x distance.

1 Like

Do something like

local part = Instance.new("Part", game.Workspace)
part.CFrame = CFrame.new((pos1 + pos2) / 2, pos1)
part.Size = Vector3.new(0.5, 0.5, x)

where pos1 is the first position, pos2 is the second position, and x is the length of the line.