Skip to main content
voyteklorenc
New Participant
February 23, 2025
Solved

Mobile Aim Assist Question

I'm working on implementing Aim Assist in my game and it's mostly going well.  I am at a stage where I need to be able to identify the player that is closest to the aiming direction of another player.

The Aim Assist Documentation explains  "Consider the game Super Rumble as a usage example. A system could be created that gathers a list of all players currently in play. The system could then periodically iterate through the list of players to find the player closest to the aiming direction of an individual with aim assist, and then set this player as the aim assist target."

How do I find the player who is "closest to the aiming direction of an individual" ?  

protoxr1487653
Honored Contributor
February 23, 2025

On each async interval I would use a world.getPlayers().forEach loop to evaluate through all players to determine which has the greatest dot product between the look direction towards each player and the forward aiming direction. This result would use both the lateral and vertical axis to determine who is most in your sights, and you could also set a threshold to ignore aim assist if the max result is still less than a tolerance of say 0.90.

Proto_XR

3 replies

protoxr1487653
Honored Contributor
February 23, 2025

On each async interval I would use a world.getPlayers().forEach loop to evaluate through all players to determine which has the greatest dot product between the look direction towards each player and the forward aiming direction. This result would use both the lateral and vertical axis to determine who is most in your sights, and you could also set a threshold to ignore aim assist if the max result is still less than a tolerance of say 0.90.

Proto_XR
SeeingBlue
Honored Contributor
February 23, 2025

Dot product is an excellent solution for this.
I also wonder if something similar could be achieved with a raycast, if the ray hits a player anywhere on the body, then snap to the chest?

Upcoming Events : Performance Pro - UI Unleashed - Building Responsive & Performant Interfaces Thursday June 19th 5:00 PM PT - Register June Programming Calendar