#best .touched() way???
1 messages · Page 1 of 1 (latest)
What’s not good with .Touched()
Or in other words what are you looking for
If you're trying to look for a better method for hitbox detection .Touched isn't as reliable than something like :GetPartsInPart()
local function Attack()
for _, part in pairs(workspace:GetPartsInPart(Hitbox)) do
print(part.name)
end
end```
to add to that, the hitbox is a part that you can say make by using Instance.new("Part"), here you can set the values.
another reliable thing you can use is workspace.Raycast() which allows you to send a ray that detects parts, it has an origin (it's starting position), the direction it's going in (relative to the origin), and parameters which allows the ray to pass through certain objects!
if you want more detailed info, refer to the roblox document!
ye im probably gonna use getpartsinpart because its easier and ill probably save raycasting for long distance