Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Quick question: Can a Ray become visble?

I want to know if there's a way or a method to make a ray visible. Thanks!

1 answer

✓ Accepted answer

you could create a part and scale/position, perhaps something like this

local startingPos = --where the ray came from
local pos = --the position the ray hit

local trail = Instance.new("Part", workspace)
trail.FormFactor = "Custom"
trail.Anchored = true
trail.Locked = true
trail.CanCollide = false
local distance = (startingPos - pos).magnitude
trail.Size = Vector3.new(0.01, 0.01, distance)
trail.CFrame = CFrame.new(startingPos, pos) * CFrame.new(0, 0, -distance / 2)

1 comment

0

Thx!

This discussion is preserved as it was. New answers, comments, and votes are closed.