AreRaysShown physics display setting

New debug setting that allows us to see rays. We have plenty of other settings that let us see things like regions, contact points, ext, so why not rays? It’d make debugging raycasts a bit easier.

36 Likes

Could definitely use this.

I can visualize this as something like:

This would help a lot when developing with raycasting.

5 Likes

I wish we could overwrite stuff in the global variable table for normal scripts with plugins so we could code our own plugins to show rays 'n stuff. :\

Shouldn’t the ray stop once it reaches the final hitpoint?

It does end at the hit point. The arrow is to show the ray’s direction.

3 Likes

How hard would it be to write your own custom RayCast function that shows such a path?

(not saying this is a bad idea, I’m actually curious)

Not very.

local ray = Ray.new(start,…)
local _,end = workspace:FindPartOnRay(ray)

local distance = (start-end).magnitude
local trace = Instance.new(“Part”)
trace.Anchored = true
trace.CanCollide = false
trace.BrickColor = BrickColor.Random()
trace.Size = Vector3.new(0.2,0.2,distance)
trace.CFrame = CFrame.new(start,end) * CFrame.new(0,0,-distance/2)
game.Debris:AddItem(trace, 1)
trace.Parent = workspace:FindFirstChild(“Ignore”) or workspace

You could, of course, write a custom ray module that automatically creates the tracer when you do FindPartOnRay, making it no big deal. Tbh I’m surprised so many people voted for this feature because I can hardly imagine needing to see all rays at once. That could get super annoying to have random rays you don’t care about clogging up your screen. Tracing out a ray sounds like something that’d best be done on a ray-by-ray basis for rays you actually cared about.

3 Likes

Slightly off topic but; What do the [S]. [X], [XL] tags(?) in the cards mean?

1 Like