My goal is to have a TextLabel presented to the screen while the player is inside of a circle. I have used collection service to include all the circles in the game for optimisation however the raycast seems to only work on a random circle only.
local InCircle = false
for _,circle in CollectionService:GetTagged("InteractionCircle") do
RunService.Heartbeat:Connect(function ()
local downcast = Ray.new(Character.HumanoidRootPart.CFrame.Position, Vector3.new(0, -5, 0))
local part = workspace:FindPartOnRayWithWhitelist(downcast, {circle})
if part then
if InCircle == false then
InterfaceModule.PromptFunction("Press E to claim this nest", true)
InCircle = true
end
else
InCircle = false
InterfaceModule.PromptFunction(nil, false)
end
end)
end