RotatedRegion3 Help

I made a skill using the RotatedRegion3 module by EgoMoose and there seems to be a bug. It may well be the way I’ve scripted the skill which is why I require help.

gif

In the gif above, I use a skill which should detect any parts touching the region 3 and print their full name. The code I’m using is this:

local Region = RR3.new(Root.CFrame * CFrame.new(0,0,-3.1),Vector3.new(4,5,5))
local PartsInRegion = Region:FindPartsInRegion3()

local Hitbox = Instance.new("Part")
Hitbox.Name = Skill.." Hitbox"
Hitbox.CFrame = Region.CFrame 
Hitbox.Size = Region.Size
Hitbox.Transparency = .85
Hitbox.Anchored = true
Hitbox.CanCollide = false
Hitbox.Parent = workspace.FX
game.Debris:AddItem(Hitbox,.7)

local Debounce = {}
for i,v in pairs(PartsInRegion) do
		print(v:GetFullName())
end

This is what prints in the output:
image

Anything I’m doing wrong? Thanks in advance.

EDIT: I forgot to mention that this happens randomly as sometimes it prints the parts of the other player and other times (like above) it does not.

I’m not sure how the module works, but you can try using the new workspace:GetPartBoundsInBox() function. It should work the same way.

4 Likes