Region3 hitbox problems

I have been making some attacks utilising Region3 for the hitboxes, however, when I started to implement them, I noticed that the hitbox was off.

Upon visualising the region3 hitbox, I discovered that the hitbox was only in the correct position when I was facing a certain direction.

https://gyazo.com/d2228d0ca1cbea4cf9b553928808a8a9
^ example of what i am talking about

            local Pos = c.HumanoidRootPart.CFrame*CFrame.new(0,0,15).p
			local Reg = Region3.new(Pos-Vector3.new(2,2.272,15),Pos+Vector3.new(2,2.272,15))
			local RTable = workspace:FindPartsInRegion3(Reg,c)
			for i,v in pairs(RTable)do
				if v.Name == "HumanoidRootPart" and v.Parent:FindFirstChild("Humanoid")then
					event:FireServer("Slash",v.Parent)
				end
			end

Local script

if (V1.HumanoidRootPart.Position-c.HumanoidRootPart.Position).Magnitude <31 and V1:FindFirstChild(c.Name.."hit")==nil then
			local B = Instance.new("BoolValue",V1)
			B.Name = c.Name.."hit"
			game.Debris:AddItem(B,.35)
			V1.Humanoid:TakeDamage(20)

Server script

Any ideas on what I am doing wrong? Is there some way to rotate it depending on the player direction? I have only just started looking into region3 for hitboxes and such. Thanks for the help.

I believe Region3 functions are now deprecated after they introduced this [annoucement](Introducing OverlapParams - New Spatial Query API .

1 Like

damn, didn’t know about that

thanks