What shape should I use for a hitbox?

I plan to use GetPartsInPart for my hitbox system, so for accuracy, which Shape should I use for hit detection?

A truncated icosidodecahedral rhombus should be simple to calculate whilst still offering great accuracy.

4 Likes

bro…

β€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œi cant tell if you’re being serious or not

while i agree a truncated icosidodecahedral rhombus would be perfect, here’s a different idea (sorry for being the fun police)

use workspace:GetPartBoundsInBox

here’s an example on how to use it

local size = Vector.new(5,7,5) -- size of the scanned area
local pos = HumanoidRootPart.CFrame * CFrame.new(0,0,-4) -- that cframe we use to multiply will scan infront of the player, tamper around with that number if needed

local scan = workspace:GetPartBoundsInBox(pos, size)

for _,v in scan do
-- your code here
end

if you need something more, here’s the documentation (edited because wrong link)

1 Like

so is this just a square?β€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œβ€Œ

uhh yeah it’s just a box the size of what you put in the size variable

you can test the box size to see if you like it via this function

-- i do want to clarify this might not work since i haven't written this in a while

function areaPreview()
local part = Instance.new("Part")
part.Parent = workspace
part.Anchored = true
part.CanCollide = false
part.Transparency = 0.5

part.Size = size
part.CFrame = pos
end

-- call the function whenever you need to
1 Like

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