Basically, my goal is to get all the players in view of a player. To do this, I was hoping to create some sort of function that if the player had to turn a certain amount to face them, they would be added to the table. Kind of like this…
My method
When I say x I’m referring to the distance sideways relative to the LookVector
When I say z I’m referring to the imaginary line parallel to the LookVector
Like this:
The method I’d thought of was trial and error until I found the right ratio of Z and X to replicate the field of view 1z = 3x etc so I could have a ratio of how much the fov opens up as you’d stare forward. From there I would subtract the owner’s Z from the target’s Z.
Now remember that ratio we talked about? I would take that new TargetZ-OwnerZ and divide it by the ratio I came up with. If (OwnerZToTheTarget/TargetX-OwnerX) < Ratio then that part would be counted. Otherwise it would be ignored.
Where it fails:
CFraming really isnt my strong suit whatsoever, so I have no idea how to get the points I described, and I’m not sure if OwnerZToTheTarget is possible to get. If you could help bring this method to life, or at least push me in the right direction, I’d appreciate that.
I can try my best to re-explain this method if you’d like to build on it.
I’m not asking for code but just what function/method I could use to achieve this? I would also appreciate a link to the wiki detailing how to use these kinda of methods in the future.