I found out about WorldRoot:GetPartBoundsInBox() but that only works for cubes, what if I’m trying to find parts overlapping a ball and actually use a ball-like hitbox?
I need to check if this ball is colliding with a specific part. This other part will be a rectangle only. One idea I had was to get a whole bunch of points along the surfaces of the rectangle and get the distance from the ball to each and every point. AND IF one of those points distance from the ball is less than half the size of the ball that would certainly mean that the ball is touching the part. I think?
This will be in a RenderStepped function and be checked for every single frame. Anyway I’m hoping there’s a better way then that.
The Origin Position where you start to start (Vector3)
How huge you want the radius to be (Number)
The optional Params if you want to change stuff (OverlapParams)
local Sphere = workspace:WaitForChild("Sphere")
local Part = workspace:WaitForChild("Part")
local Params = OverlapParams.new()
Params.FilterType = Enum.RaycastFilterType.Blacklist
Params.FilterDescendantsInstances = {Sphere}
local OverlappingParts = workspace:GetPartBoundsInSphere(Sphere.Position, 4, Params)
print(OverlappingParts) -- Should output back as 1 Part inside the table