I’m working on a horror game where when you look at the entity you begin to lose health, only real issue with this is that the way my game determines ur looking at this entity is through the client which I’m pretty sure we can all agree isn’t a very good way of determining this though to exploiters (If you know any ways on the server to determine if an entity is in a players field of view and is pretty accurate, please feel free to say) my idea to getting around this was just to make a raycast in front of every player starting from there head and maybe go about 100 studs in front to check if they are looking directly at the entity, obviously this method would only work if you looked directly at the entity but I’m pretty sure exploiters would find it hard to have fun in the game if they constantly got kicked when they accidentally looked directly at it, before I ended up writing this whole system though I just wanted to get some in-sight on what others think of this idea, and if doing this many raycasts would tank performance.
Here’s just some information about the game:
The game in it self rn is pretty well scripted and optimised, it’s about 9 players max (1 player will be the entity so it will be raycasting on 8 players) and it also uses the future lighting technology (Mentioning because it lowers performance).
(Sorry for any English mistakes, wrote this pretty fast will re-read a couple times!)