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.
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)
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
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.