How could i make the white lines around the range like tdx

image

hello developers, im looking for someone to explain how the white lines can be created?

ive already created the range itself and i have no idea how to create the lines
i tried making them before but it seems unidentical

image
heres my attempt in recreating it

I’m assuming you can use a Selection Box.
image
image

Do this but set the darker gray to transparency 1.

1 Like

Some sort of formula i guess? has something to do with RangeRadius, 180 degrees part rotation, and Angles to position the part correctly
The easiest way would be creating a blender mesh and scaling it ingame to your radius

i dont think selection box works
unless im using it wrong

i dont think its just a single mesh being used
the amount of lines are created depend on the range

i was able to make something similar using unions
but im still not exactly sure if thats the solution

Formula is the solution as i said before

just found out how its possible
thanks for all the help

At the moment I am also developing a TD game and would really like to make a radius like in TDX. How did you manage to do this?


just made this

local RunService = game:GetService("RunService")
local Radius = 5

local function ReturnPart()
	local part = Instance.new("Part")
	part.Anchored = true
	part.Color =Color3.new(1, 1, 1)
	part.Material = Enum.Material.Neon
	part.Parent = workspace 
	part.Size = Vector3.new(0.1,0.1,1) 
	return part
end

local function DoubleDottedCircle(Radius)
	local LinePerRadiusX = 10 
	local MinLines = Radius * 4
	local AllLines = math.floor(Radius/LinePerRadiusX)+MinLines/2  
	for i = 1,AllLines do 
		local part = ReturnPart()
		part.CFrame = CFrame.Angles(0,math.rad((360+(360/AllLines) - i * (360/(AllLines)))) + 360/AllLines,0) * CFrame.new(0,0,-Radius) * CFrame.Angles(0,math.rad(90),0) 
	end  
	for i = 1,AllLines do 
		local part = ReturnPart()
		part.CFrame = CFrame.Angles(0,math.rad((360+(360/AllLines) - i * (360 -360/(AllLines))) + 360/AllLines ) ,0) * CFrame.new(0,0,-Radius) * CFrame.Angles(0,math.rad(90),0)  
	end 
end

local function DottedCircle(Radius)
	local LinePerRadiusX = 10 
	local MinLines = Radius * 4
	local AllLines = math.floor(Radius/LinePerRadiusX)+MinLines/2  
	for i = 1,AllLines do 
		local part = ReturnPart()
		part.CFrame = CFrame.Angles(0,math.rad((360+(360/AllLines) - i * (360/(AllLines)))) + 360/AllLines,0) * CFrame.new(0,0,-Radius) * CFrame.Angles(0,math.rad(90),0) 
	end  
end


DoubleDottedCircle(5)
DottedCircle(10)

Quite a useful formula! But I still can’t figure out how to make the radius “limited” in the presence of obstacles. Is there any way to do this or is this not the right topic to discuss this? It would be very useful.

The easiest way would be raycasting from lines to character, Creating a mesh of this shape, repositioning it, resizing it, and making a Union with a circle

The harder way would be making this circle an Editable mesh and knowing damn well you are doomed in formulas

I think sooner or later I will find a way, thanks for some help.

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