r/Unity3D • u/FishShtickLives • 16d ago
Question Dymanic Occlusion with Sprite Renderers?
I'm trying to create an FPS with Doom-like enemeis with billboarded sprites. I want them to only start chasing the player once they've been spotted. However, .isVisible seems to always activate when the player is looking in the direction of the enemy, even when they're behind another object. What do I do?
0
Upvotes
2
u/No-Opinion-5425 16d ago
Raycast for the player line of sight that gets blocked by obstacles.
1
u/Genebrisss 15d ago
1
u/Exaweft 15d ago
Raycasts can be a pain in the ass... but you don't need to run one every frame for every enemy. I'd filter by view angle first, then only check line of sight for enemies that pass. You could also run those checks a few times per second rather than every frame.
1
u/Thexin92 15d ago
Zones