Major issue related to region3

Hello! I’m trying to create regions for a prison game, but I don’t want the parts to be in the workspace. I found this video on region3 where it prints the players name every time the player is in a certain region.

My problem is that all of these parts I set up for my game aren’t working. It works on any other part, just doesn’t work on these.
image

  1. It works well if I copy everything and paste into a baseplate. No luck in my actual game for some reason, here’s the code I was working with if it helps.
local part = game.ReplicatedStorage.Regions.Yard1

local region = Region3.new(part.Position - part.Size/2, part.Position + part.Size/2)


while true do 
	local parts = workspace:FindPartsInRegion3(region, part)

	for i, part in pairs(parts) do
		local player = game.Players:GetPlayerFromCharacter(part.Parent)
		if player then 
			print(player.Name)
		end
	end

	wait(1)
end 

I’d really appreciate if someone could show me what’s happening or a better way to accomplish what I’m trying to do.

Is there any output when you test it?

If i use any other part, yes. But for some reason the color coded parts in the image don’t work

You can make your parts fully transparent and disable CanCollide so that players don’t notice it. Then you can use GetPartsInPart. You can also just use a TouchEvent, but an exploiter can just delete the part client-side and not trigger the event. Region3 isn’t really used anymore, outside of Terrain related things, as GetPartBoundsInBox is easier and better to use instead.

1 Like

No, I already knew that. I can’t because some other scripts depend that the regions aren’t in the workspace. It also disrupts camera, player hitbox, etc.

This doesn’t matter. You can path to an object regardless of where it is or where the script is, as long as the script is in a place that it can execute in and the script is able to see the object you’re pointing to.

I’m not sure what you mean by this. A transparent non-collide part will not affect any of those things except for raycasts. Disabling CanQuery will fix that part.

1 Like

Thank you! Turns out some previous testing with transparent hitboxes were done incorrectly.

1 Like

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