I’m using Region3 for the first time, I’m not sure if it’s acting correctly or if I’m using it wrong.
What I’m trying to do is find if there are any parts in a certain area. I have 2 parts in each corner of the Region to get the area.
--Region1
local Region1 = script.Parent.Region1
local X1 = Region1.Position.X
local Y1 = Region1.Position.Y
local Z1 = Region1.Position.Z
--Region2
local Region2 = script.Parent.Region1
local X2 = Region2.Position.X
local Y2 = Region2.Position.Y
local Z2 = Region2.Position.Z
while wait(5) do
local Region = Region3.new(Vector3.new(X1,Y1,Z1),Vector3.new(X2,Y2,Z2))
local isEmpty = workspace:IsRegion3Empty(Region)
print(isEmpty)
end
When I change it (workspace:IsRegion3Empty(Variaties)). It either prints false constant or true, but when parts enter or leave the area. It continues to print the same thing.
I changed it to this but nothing happended. It checking the same area each time so positions wont change.
local Region = Region3.new(Vector3.new(X1,Y1,Z1),Vector3.new(X2,Y2,Z2))
while wait(5) do
local isEmpty = workspace:IsRegion3Empty(Region)
print(isEmpty)
end