#Maximum distance of a hitbox?
1 messages · Page 1 of 1 (latest)
local Distance = (HitBox.Position - Part.Position).Magnitude```
yea i know thats how you find the magnitude, but im trying to do a sanity check and im not sure what to put for the maximum distance
Gotcha you could use HitBox.Size.Magnitude
unless your hitbox is a sphere, magnitude is not how they work, but as the name suggests, a hitbox is not a sphere, it is a box
and even if your hitbox were a sphere, you still can't use magnitude unless the other part touching it is also a sphere, which is usually not the case
oh, so how would i do the sanity check?
and even if both parts were a sphere, you still can't use distance between the 2 centers of the spheres, well, not directly. you need to do more work to it. namely add the radius of the second sphere to the first, and only then can you compare the distance.
visual demonstration of why that works