πŸ’¬

Community answer

Collected from the ACE community Discord archive around 2023-05-25. It may be informal or outdated β€” anyone can edit this page to improve it. Original discussion

Finding closest visible player for a turret

πŸ”« WeaponsUpdated 2 days agoβ€’0 views
for _,ply in pairs(find.sortByClosest(find.allPlayers(filterFunc), turret:getPos(), true)) do trace.line(turretPos, ply:obbCenterW()) end - sort by distance the…

How to pick the closest player a turret can see

for _,ply in pairs(find.sortByClosest(find.allPlayers(filterFunc), turret:getPos(), true)) do trace.line(turretPos, ply:obbCenterW()) end - sort by distance then ray-check each candidate.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.