FOV visualization [Tower Defence Resources]

Mesh:
– 65 Verticies
– 64 Bones

local Radius = 16 -- ANY NUMBER WORKS, Except it gets less precise after 64
	local primary  = " INSERT YOUR PART HERE "
	
	local PDestroyer = workspace:WaitForChild("PerformanceDestroyer"):Clone() -- "CHANGE THIS PATH"
	PDestroyer:ScaleTo((Radius*2)/40)
	PDestroyer.Parent = workspace
	PDestroyer:MoveTo(primary.Position + Vector3.new(0,0.1,0))
	
	local raycastparams = RaycastParams.new()
	raycastparams.FilterType = Enum.RaycastFilterType.Exclude
	raycastparams.FilterDescendantsInstances = {} -- 
	
	for _,v:Bone in pairs(PDestroyer.Circle:GetChildren()) do
		local ray = workspace:Raycast(primary.Position,CFrame.new(primary.Position,v.WorldPosition).LookVector *Radius,raycastparams)
		
		if ray then
			print(ray.Instance)
			v.WorldPosition = Vector3.new(ray.Position.X,primary.Position.Y,ray.Position.Z)
		end
	end
	

PerformanceDestroyer.rbxm (13.9 KB)

15 Likes

whats performance destroyer on the script?

1 Like

The name of the Model (blue circle) is PerformanceDestroyer

1 Like

I think I can call this “Radius indicator” or “Field of view visualization”. I’m not sure what is this exactly called.

1 Like

similar to what i called mine, “radiusInator” lol

2 Likes

Yoooo, I searched through entire internet, I think you meant this

Am i right? This is too familiar…

1 Like

I hate to nitpick, but:

How would it see through a bit of the wall here? :thinking:

It’s a great start, though. I wouldn’t be able to figure out how this works at my first few thoughts! :+1:

2 Likes

Hi there, Mesh uses 64 Bones, some angles will be skipped, You can make similair mesh in blender with 360 Bones and get precise results

2 Likes

Can’t this be done using a SurfaceLight in Future Lighting?

1 Like

If you want your character to possess the full concentration of the sun. Potentially losing detail by trying to increase the brightness in a bid to make the visualization show more profoundly.

Personally, I wouldn’t want my character’s to be illuminated in such a way as a gimmick to achieve this effect. So this resource is great for aesthetics reasons.

3 Likes

A great resource, thank you @azazinchic

i believe a better name for the post could be line of sight visualization or raycast visualization

FOV, feel of view, seems spot on …

Thanks for sharing OP, what are you going to use it for?

Yes, that is the one i wrote :fire:

That’s perfect but 1 problem, I can’t get the highlight to be somewhat transparent, changing the transparency of the mesh makes the highlight disappear

Hello, Roblox does not support Highlight with transparent meshes, Instead you can try cloning your part and make the cloned one a little bigger, Set both to Neon material

you can experiment and get some cool results

if you want highlights to work on transparent parts
just create a model with a humanoid inside and the rest is obvious

also great resource, thanks alot!

1 Like