- Home /
Question by
Ninjinski · Nov 17, 2020 at 03:08 PM ·
2d gamecollider2draycasthit2dfovcollider.raycast
Is there a way of casting Rays at the end of the collider of an object ?
Hello, I'm working on a 2d top down unity game in multiplayer.
I'm trying to create a player FOV using RayCastHit2D.
For that, I'm using a black layer and different Mask level to hide the ennemies behind the black layer mask (screen below)
The problem is that my i'm stopping my rays when they hit a gameObject with a specific layer but then this object is draw under the shadow. So, is there a way to make the ray stopping not at the beginning of the object's collider but at the end of it ?
capture-decran-2020-11-17-a-180357.png
(466.4 kB)
Comment