[SOLVED] Raycasts in a sphere shape

Hey Dev form!

I’m working on a project that uses a lidar type effect, I’m wanting multiple type of scans (Cone, Line, Etc…) One of them I thought of was a sphere scan I started working on it getting it to make a “circle” but im not sure how to make it a 3d.

This is what it looks like right now (Top Down)
image

And this is the code I have for it:

function LidarController:LidarInSphere(ammount, origin, lidarFrame)
	for i = 1, ammount do
		local angle = math.pi * 2 * (i / ammount )
		local direction = Vector3.new(math.cos(angle), 0, math.sin(angle))
		local result = workspace:Raycast(origin, direction*self.LidarDistance, self.rayParams)

		if result then
			self:PlacePart(lidarFrame, result)
		end
	end
end

I cant use a sphere cast due to I need the individual points of hit for my effect.

(Close up)
image

Thanks in advance!

I cant use sphere casts (I saw your post before you deleted it)

I found a post about it! No idea how i didnt find it until after I posted it (I was searching for a good hour)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.