- Home /
Detect visibility for anti-hack (see trough wall)
I'm working on a anti-hack system and I need to detect visible objects (from a specific position with fov) but I can't find any solution/example or API. There is a renderer.isVisible
property but it just gives us 'will camera render it?'. I want something different, can a camera (with fov) see the target object meshes. I've tried to achieve it with Physics.Raycast
but I failed because target object can be located between two different walls and this scan is not a linear scan, it's area scan. So, I know that's a specific solution but can anybody suggest something?
Why does isVisible not do what you want? I think it might also count in scene view, if you tried it and it didnt work as you expected.
Answer by hav_ngs_ru · Feb 02, 2015 at 09:36 PM
Maybe MeshCollider the same shape as camera-fov, attached to camera + OnTriggerEnter?
I can already detect fov space with angle + range combination without colliders but this is a little different thing. If I'm in camera's fov space but you can't see me because of wall, server will not send me your update packets. It looks like dynamic occlusion but this is visibility test. As I said:
can a camera (with fov) see the targer object meshes
hmm... ok, now I've got wat you want. But I still don understand why not to use raycast?
I'd use 4 raycasts from camera to collider.bounds' corners and one raycast to center of mesh to be sure that player definetely don should see target. Yes, it will be some "dead" conditions when player can see target but doesnt see it in fact, buit it will not causes false alarms. In other words, there are possible combinations:
raycast hits, isVisible true - ok
raycast hits, isVisible false - dead condition, we ignore it
raycast doesnt hit, isVisible true - CHEATER!
raycast doesnt hit, isVisible false - ok
"raycast hits" means "at least one of raycasts hit"
I also think like that but I just wonder "can" anybody handle those "dead conditions". Btw, thanks!
door lock does not make it impossible to enter into the house, but it makes it so difficult that it does not worth the effort.
if you hacker already changing client application - he could handle any protecion in theory. but 90% of hackers will stop attempts after first difficulty, 9% - after second, and remaining 1% will prefer hack Pentagon ins$$anonymous$$d of your game :).
does you effort matches the real danger of hacking?
Ask Cro$$anonymous$$m for some advice. They are masters of Anti-Piracy.
http://gamerant.com/serious-sam-bfe-piracy-scorpion-tao-120204/
Your answer
Follow this Question
Related Questions
Raycast problems in my AI 1 Answer
Physics.Raycast AI problem 1 Answer
Physics.Raycast 2 Answers
Physics.Raycast does not work On NotWalkable Areas Of Navmesh. 1 Answer