|
I want to make a script that uses the OnBecameVisible/Invisible to control the roof fans of my level. When I turn and see the fan I want it to be activated but only if the fan is not occluded by a wall or something. Is there a way to verify if an object is totally visible by the main camera? Thanks any help! =]
(comments are locked)
|
|
If you are using Occlusion Culling (Pro only), using Renderer.IsVisible may well work. If not you would have to do multiple rayCasts towards your fans and determine if they were hit or not, using your walls/obstacles in the Layer Mask. Thank you! =)
Jul 16 '12 at 06:50 PM
ronaldosilva
If an answer helps, please upvote and mark as answer so we know your question is answered.
Jul 16 '12 at 06:51 PM
Meltdown
Actually, its not working =/ I put a rotating cube behind a wall, and event if I am looking at that wall, the cube is still rotating. Looks like if the cube is in the frustum view, its processed as visible anyway.
Jul 17 '12 at 03:24 PM
ronaldosilva
(comments are locked)
|
