How to use GetBoundsInBox()

I’ve been searching and searching and experimenting but I can’t find a single thing that helps me do what I want to do.
I want a event to be casted and then a box made every time it is casted. Done.
I want to filter it so that the player that casted the box isn’t affected by it, and the people in the box are. I just have no Idea how to do this lol. Could someone not just simply write a script but give an explanation so I could use this on other projects as well. I was told on a different post it is a great alternative to hitboxes.

1 Like

GetPartBoundsInBox()
Essentially what this does, is take the hitbox of a part, and return all colliding hitboxes from other parts. You know the box that appears when you hover your cursor over parts? That’s the bounding box, this is a great alternative to hitboxes because you don’t need to always fire .Touched.

1 Like

the GetBoundsInBox function is used to get parts inside of a bounding box. an invisible one, not a part. you put the cframe for the first parameter, and then the size. and then some params.

example:

local part = workspace.Part

local overlaps = OverlapParams.new()
overlaps.FilterDescendantsInstances = {part}
overlaps.FilterType = Enum.RaycastFilterType.Exclude

local partsInBox = workspace:GetPartBoundsInBox(CFrame.new(), Vector3.new(5, 5, 5), overlaps)

this will return the parts in the bounding box, the invisible one. this is mainly used for zones. like the lighting zones

2 Likes

ive seen u before…

#30charrrr

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.