Need some Help Setting Region3 CFrame

I’m trying to the Region3’s CFrame to the Torso position. But I get this error:

CFrame cannot be assigned to

I’ve done seem research and other people seem to have similiar problems, I’ve tried their solutions but it hasnt worked. It’s probably something simple I just dont know, heres my script:

local model = bot:Clone()
local torso = model:WaitForChild("Torso")
local humanoid = model:WaitForChild("Humanoid")
	
local region = Region3.new(Vector3.new(0, 0, 0), Vector3.new(10, 10, 10))
region.CFrame = torso.CFrame -- Error line

local part = Instance.new("Part")
part.Anchored = true
part.Size = region.Size
part.Parent = workspace
	
model.Parent = workspace

Try region.CFrame = CFrame.new(torso.Position)

Edit: Nevermind, didn’t look through the script well

1 Like

Like the error says, you can’t modify the CFrame of a region3, but you can create it with an offset

Already tried that, yeah still same error

Yes, but how would I do that???

local torsoPosition = torso.Position
Region3.new(torsoPosition + Vector3.new(0, 0, 0), torsoPosition + Vector3.new(10, 10, 10))

This offsets the region’s position

1 Like

Since you’re trying to place the Region3’s CFrame in the middle of the torso, you should instead be doing something like this:

Region3.new(torsoPosition - Vector3.new(5, 5, 5), torsoPosition + Vector3.new(5, 5, 5))
2 Likes