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

How to determine a Vector3 Position inside of a Circular Field?

I’ve been messing around lately, and decided to try and figure out how to determine the Vector3 location of an object, inside of a circle. The Circumference is based of the the FOV/2, you could say this is somewhat like a detection field, I’ve tried a lot of methods, but they just don’t work, could someone help me write an algorithm?

Thank you!

2 comments

0

I'm confused. Are you asking how to determine if the object is in the circle radius, or are you asking how to get the vector3?

0

Circle radius

1 answer

Here's a solution:

local sphere = workspace.sphere
local part2 = workspace.part2

while true do
	wait()
	if (sphere.Position - part2.Position).magnitude < sphere.Size.X / 2 then
		--do whatever you want
	end
end

It might be a bit less efficient than other methods.

Hope this helps!

1 comment

0

Where did you find this? I also wanted a circle not a sphere

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