workspace:FindPartsInRegion3 is ignoring parts

workspace:FindPartsInRegion3 is ignoring parts in diferent folder

You’re going to need far more information included in this thread if you’d like help with your issue. There isn’t even a question

Please be sure to see the Scripting Support category guidelines as well to know what to include in a thread. You should also try things yourself such as debugging, fixing and researching. Once you’ve exhausted options, then feel free to post.

2 Likes
local parts = workspace:FindPartsInRegion3(region)
for _,v in pairs(parts) do
	print("hit "..v.Parent.Parent.Name)
end

when i do this, it will ignore parts in other folders

You can use workspace:FindPartsInRegion3WithIgnoreList(region, descendantsTable) if you’re looking for a way to ignore certain parts that are descendants of a folder. It’s hard to tell what you’re looking for because of the lack of clarification in your OP.

Make sure to wrap your folder in {} since it’s a table.

You need to check two things here: that your console isn’t throwing an error and that your region is correctly capturing points. I don’t think it’s “ignoring” parts.

To check if your region is correctly capturing points, run workspace:IsRegion3Empty(region) and print out the results.

Your responses still lack the information required to help resolve this issue.

@EncodedLua OP is searching for a way to capture parts, not to ignore them.

there is no error, but it is hard to check, if the part is in position, because the region is moving, but i think yes

1 Like

https://developer.roblox.com/en-us/api-reference/function/Workspace/IsRegion3Empty

Wouldn’t say it’s hard to check. Found this with a quick search. Apply this to your code to check if a region is empty. If it is, your region isn’t capturing parts. That would be the cause for no parts in your Region3 call return table rather than them being supposedly ignored.

Make sure that your Region3 is created properly. I’ve had weird behavior when constructing them incorrectly. For the first Vector3 argument in the construction of Region3, make sure to use the less of the 2 X Y and Z coordinates. For the second argument use the greater set of dimensions.

there is problem, because i the region is car hitbox, so the car is in

If your hit box is part of a car, it more often than not has some sort of rotation. I would recommend using EgoMoose’s Rotated Region3 module since Region3 contents can not be calculated if the region is rotated. Rotated Region 3 Module

Not a problem. Pass the model of the car as the second argument. If you need even more control after that, no issue at all: IsRegion3EmptyWithIgnoreList.

isnt there some way how to fill the region with green color,…

What is the purpose of your code? Are you trying to make a bounding box around the car that’s green?

No for game, but i want to make the region3 green because debug reason, so i can easily see if the part is in it, because now, it is touching other cars