My Region3 isn't detecting enemy

I want to have my Region3 to work.

It doesn’t detect the players humanoid to damage it (I need Region3 due to if the player doesn’t move .Touched wont register.

DevHub, and much more DevForum posts with no luck of help.

I am using a ServerScript and I am kind of making my own type of UTG Monster. (I am not making a UTG) but it doesn’t seem to be print the players Character (Can also be a dummy so I can’t do :GetPlayerFromCharacter)

-- The REGION
local Region = Region3.new(Vector3.new(6,0,6),Vector3.new(12,6,12))
	local part = Instance.new("Part",workspace)
	part.Anchored = true
	part.Size = Region.Size
	part.CanCollide = false
	part.Position = MainMover.Position

-- The DAMAGING EVENT
coroutine.wrap(function()
		while true do
			local parts = workspace:FindPartsInRegion3(Region, part, 2000)
			task.wait()

			if ending == true then
				break
			end
			for i,v in pairs(parts) do
				if v.Parent:FindFirstChild("Humanoid") ~= nil then
					print(v.Name)
					local char = v.Parent
					char.Humanoid.Health = 0
				end
			end 
		end
	end)()

Also sorry for the code formatting Google broke it.

I would appreciate help due to this is a very important project for me.

Well hey I didnt realize this either but they apparently deprecated Region3 when they added Spatial Queries.
see post → Introducing OverlapParams - New Spatial Query API

Oh so Regions don’t work asmuch anymore???-

Apparently.

Okay well any good YOUTUBE videos to help me with OverlapParams due to DevHub sucks


I think this is how you make the overlap. Pretty similar to the Regions

So that puts a new part into a CFrame and then it goes for the size then the parameters? (also if I wanna check if something touched it how would I get the OBJ like .touched)

Oh well its basically a region ( it gets all the parts currently touching it )
id do

local parts = game.Workspace:GetPartBoundsInBox(CFrame.new(),Vector3.new(1,1,1),overlap)
for i,v in pairs(parts) do
-- these are all of your parts that are touching the obj
end

I dont think you can do .touched event

also good link for OverlapParams

1 Like

THANK YOU SO MUCH!!! I am so happy :slight_smile:

1 Like

No problem hope all goes well!

1 Like

I can finally make my UTG Type Monster

They work as they always have, they’ve just been deprecated is all.