Why is region3 so laggy? How can I improve it for what I want to do?

So I made a script that uses region3, but when I make the resolution over 2000 because the size is around that big it doesn’t seem to want to run smooth.

That may not be the problem though, what I think is the issue is all of the parts the region3 is picking up inside of it. How can I make sure that the region3 doesn’t add 1 million parts to it?

I updated the script so it only picks up things inside of players, but it’s still laggy…

Sounds like you’ll want to use FindPartsInRegion3WithWhiteList:

local r3=Region3.new(Vector3.new(),Vector3.new()) --make a region3
local whitelist={} --create a list
whitelist:insert(workspace.Baseplate) --add items that can be detected to the table
local results=workspace:FindPartsInRegion3WithWhiteList(r3,whitelist)

Also, for future reference, there’s no need to reply to yourself. You can edit your post by clicking on the pencil icon near the bottom of your post to add more information.

3 Likes

What is your use case? There is probably a better way to do it.