Hi,
So I have noticed in my fps game that aiming is very hard, and I decided to add aim assist.
What I want is to check in the array of enemies if there are some enemies near to the center of the screen, check who is the nearest one and make the camera slowly look at it, so it helps you aiming.
The half extents of physics box cast allow for the specification of the box size and length by a Vector3 X Y Z. Without following a Google tutorial who will only display popular results(which can be achieved via cheating YouTubes view count alongside a VPN by hiding or faking the unique origin of the videos interaction) - using a physics box cast will allow you to specify a rectangle from the centre of your cam and stretch to the effective range of auto assist covering some area and detect hits within that area. Allowing you to auto pickup a target within a set range. But as an auto assist isn’t ideal for a skill based shooter your theory of storing enemies in an array will make your auto assist extremely overpowered. While a boxcast can be done on set frames allowing the player to make an attempt at aiming before the assist kicks in. Otherwise I can imagine you are running through a level and suddenly your players look rotation is looking directly at the head shot of an enemy that is over 90* to his left or right
My game is something like titanfall 2, but its more scoped on the movement. The reason I want aim assist is that I find pretty hard to aim when wallrunning or sliding. Wich I wanted was that the camera rotated smoothly 5-10 degrees. One thing I forgot to mentios is that my game has projectille bullets. I will try casting a box instead of a ray for the calculations.
It’s just that the ray has to be precise to the aim reticle while the box can extend the bounds of the aim reticle. So it could potentially pick up something a few meters to the north south east and west of the aim reticle. And then use this detection to perform the auto aim tracking until next box cast.