#What is the fastest and most efficient way of getting the closest player to a position?

31 messages · Page 1 of 1 (latest)

narrow flare
#

I know many ways to do this but I require something fast and very efficient.

placid rivet
#

probably spherecast

#

with huge radius

narrow flare
#

I would be putting this on an object, and it should not be able to detect the player who is holding it, so that might not work.

placid rivet
#

I guess clamp a look at gismo and raycast to where it's looking

#

configure closest player

narrow flare
#

If a look at gizmo can do it, I can probably do it with circuits.

#

I came up with this, it runs for all players but only takes 2.80 cpu

summer laurel
# placid rivet probably spherecast

This wont work @narrow flare because spherecast will not detect anything in the starting sphere

This basically means, you cant detect anything within the distance of Radius from the starting position

#

It sucks

summer laurel
narrow flare
#

I didn’t use sphere cast, I’ve actually never used it at all.

summer laurel
#

Basically imagine raycast but in the shape of a pill

narrow flare
#

Oh Ik what it is

#

Just never used it

merry ledge
#

You can use the Overlap Sphere, use a Get Last Equipped Player and connect Currently Equipped to an If Value, then attach If Value to a Get Element, make the Then (1) and the Else (0).

Make sure to configure the Overlap Sphere to Ignore Objects as well!

#

This will get the closest Player to that position, however if it is being held then it will move 1 index and get the next closest player. You can also just use an Equals chip to the Player that is holding the Object and if it Equals to the Closest Player, then the If Value moves the next index

#

@narrow flare

narrow flare
#

No longer need help but thank you.

merry ledge
#

But I'd say the Variable one is better

#

Aight, have a good day!

summer laurel
#

It does orders it however the fuck it wants

merry ledge
#

Not in my experience, even after checking Distance.

summer laurel
merry ledge
#

Huh

summer laurel
#

I mean, there is a chance that all items just so happen to by ordered by distance

But Overlap Sphere orders them how ever the fuck it wants, which is probably a bug

merry ledge
#

Hopefully, because it should be doing Distance anyway (First Hit First Index Basis)

summer laurel
#

which is also dumb to me