Region3 Oriented Weirdly

I’m using Region3 as an anti-exploit measure to respawn noclippers and glitchers in the kitchen of a cafe. Because of the design, the kitchen is oriented on the Y axis at about 10-20 degrees or so. Can I add an orientation offset to the CFrame of the Region? From everything I’ve tried so far, it’s throwing “CFrame cannot be assigned to” errors.

local NewRegion = Region3.new(
				Vector3.new(
					math.min(v.Point1.Position.X, v.Point2.Position.X),
					math.min(v.Point1.Position.Y, v.Point2.Position.Y),
					math.min(v.Point1.Position.Z, v.Point2.Position.Z)
				),
				Vector3.new(
					math.max(v.Point1.Position.X, v.Point2.Position.X),
					math.max(v.Point1.Position.Y, v.Point2.Position.Y),
					math.max(v.Point1.Position.Z, v.Point2.Position.Z)
				)
			)
			v.Point1:Destroy()
			v.Point2:Destroy()

			NewRegion.CFrame = NewRegion.CFrame * CFrame.Angles(0, math.rad(20), 0) --my attempt

			local NewPart = Instance.new("Part", workspace)
			NewPart.Anchored = true
			NewPart.CFrame = NewRegion.CFrame
			NewPart.Size = NewRegion.Size

(not sure why it’s formatted so weirdly on devforum)

1 Like

Because Region3 uses Vector3 values.

I think this is the module that what are you looking for:

1 Like

Thanks. I was under the impression that Roblox would have made a workaround to this or an easier method or something but I guess not.

Sorry for bumping this topic

I was surfing on forum and I came accross a post that included this twitter link:

These functions can be used as replacement for Region3, but I’m not entirely sure.