How do i detect if object is visible from camera.
Basically, i need a pretty basic vision detection. Camera sees the object from behind, but i need to know if there are any walls blocking the object. How do i fire rays at this object at parts the camera sees? No, firing at tanks pivot point is pretty awful way to do it, as it doesnt work if the center of tank is blocked by anything.
just detect if object is on the cameras viewport Vertical coordinates 0 (center) and fire ray there, if ray hits a wall, move slightly up, fire again and so on. But for performance reasons i dont want to bombard entire screen with rays, just the region where the tank is actually located.
Answer by DialBlitzness · Aug 09, 2020 at 02:46 PM
Hello!
I think you can add a "Volume" component to your camera, add a collider that you will widen to the field of view you want and make it a trigger. The idea is to detect all the objects that enter or leave the field of vision covered by the collider.
Would that be a good lead?
Your answer
Follow this Question
Related Questions
raycast activation by trigger 0 Answers
The raycast is allways looking to the camera. 0 Answers
Raycast hit 2 Answers
Photo Morphing Face Detection Game 0 Answers
How to make a dynamic wall generation 0 Answers