Magnitude vs getpartsinradius for capture point system performance?

I’m looking to make a capture point system for around 20-30 players.
But I was curious if magnitude or get parts in radius would be better for performance.
Even if the performance difference is small, it would be very helpful since I am going to have a lot of other things running as well.

I’ve read other posts that say magnitude is cheaper than get parts in radius, but when the numbers reach high amounts the conversation got vague with some saying get parts would be cheaper for higher numbers of parts/players. Would magnitude or get parts be better for around 20-30 players?

I was going to run a loop every second to check if any players of opposing teams were close enough to the capture point. Whether by magnitude, or get parts in radius.

For example of the get parts in radius, I was going to make the max parts it could fetch the same as the server player count, then make a different collision group that only targets player rootparts, so it wouldn’t proc other parts.
Or I was going to use magnitude, and get:Players() to filter through all of their humanoid root part distance from the capture point.
Which one would you say gives better performance?
Since I will have a lot of other things running in game.

There will only be 20-30 players at most, so maybe magnitude would be more performant?

Or should I instead use the zoneplus plugin/module to make a zone capture point? How performant is zoneplus anyway compared to magnitude/getpartsradius?

I think what you’re trying to do is get all the players within a certain radius?

In that case definitely use vector magnitudes since, even though they require squares and square roots, are better than checking the bounding boxes of a ton of parts.

Getting the magnitude of distance between the HumanoidRootPart and the goal position of only 30 players should have very little of a performance impact.

There’s no way it errors when you send a post that says “30 characters” lol, that’s why I replaced it with 30 players

1 Like

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