It's there a way to make Region3 follow a Part?

So i want to make a part that is attached to the player and detects all other players inside it, i used region3, because i thought it would work good with the part, but i don’t know how to make the region3 follow the part. I tried doing a update function just to change the Region3.Cframe to Part.Cframe but the script just don’t work.
This is my script:

player = game.Players.LocalPlayer

local part ="Part")

local weld ="Weld")

local partcr = false

local region

local created = false

function makepart()

if partcr == false then

partcr = true

weld.Name = "circleweld"

weld.Part0 = player.Character.UpperTorso

weld.Part1 = part

weld.Parent = part

part.Size =,20,20)

part.Parent = player.Character

part.CanCollide = false

part.Transparency = 0.9




function createregion()

region =,,20,20))


function findpartsinregion()

local partsFound = workspace:FindPartsInRegion3(region, part)

for i, part in pairs(partsFound) do

if part.Parent:FindFirstChild("Humanoid") then

print("found:", part.Parent.Name)

local selectedplayers = part.Parent.Name

print("player selected")




function update()

region.Cframe = part.CFrame


while wait() do



update() --if i call this function the script stops working


Please use codeblocks as they make the code easier to read.

This is a test

Also, you need to post any errors that occurs from the script

Oh, thanks, i’m new in the roblox forum i never made a topic

Finding parts transiently in a rotated region is not possible, the engine only supports axis aligned FindPartsInRegion3. You could use a heavier weight approach like creating a temporary part and querying GetTouchingParts() on it which would allow you to query an arbitrary region but cost a lot more.

Here is what I use. I place this code inside of a localscript, inside of the StarterCharacterScripts in order to define a region that is based on a size and placed in front of the character in order to grab items in a BOX REGION in front of the character, such as picking up coins. The coins are placed inside of the CurrentCamera so they are only visible to that individual player. I also use FindPartsInRegion3WithWhiteList instead of FindPartsInRegion3 because I can whitelist the parts that are being checked for faster processing. This is not a complete solution, but will give you an idea of how to handle this. You can set the transparency of the part to a visible value to show the box you are checking.

			local player = game.Players.LocalPlayer
			local Humanoid = game.Players.LocalPlayer.Character.Humanoid
			local character = player.Character
			local hmndrootpart = character:FindFirstChild("HumanoidRootPart")
			local DoorTouched = false
			-- wait for the player GUI to load
			-- define a regional visualization part
			local regionSize = 6
			local heightSize = 7
			local visualizeRegion =,1,1),,heightSize,regionSize))
			-- print("VisualizePart Created")
			local visualizePart ="Part", game.Workspace.PlayerObjects)
			visualizePart.Name = player.Name.."-visualizePart"
			visualizePart.Anchored = true
			visualizePart.Size = visualizeRegion.Size
			visualizePart.CFrame = visualizeRegion.CFrame
			visualizePart.Color =,0,0)
			visualizePart.Transparency = 1
			visualizePart.CanCollide = false
					-- buffer slightly
					-- move the part to the players position and adjust it based on the lookvector of the humanoid
					visualizePart.Position = hmndrootpart.Position	+ hmndrootpart.CFrame.lookVector * (regionSize / 2)
					local PlayerSearchRegionTest =,visualizePart.Position+(visualizePart.Size/2))				
					local parts = workspace:FindPartsInRegion3WithWhiteList(PlayerSearchRegionTest, {workspace.CurrentCamera}, 1000)
						-- loop through the parts array and print the name of each part
						for partIndex, part in pairs(parts) do 
							if part.Name == "CoinPart" then									
									-- Do processing here

You will need to create a folder called PlayerObjects in game.Workspace in order for this example to work. Sorry.


Have I ever told you, your my hero.