I’m n00b in Unity and C#.
I’d like to make something like Hotline Miami, but in 3D and so that player can’t see through walls. I don’t know where to start, but I found this nice article: http://www.redblobgames.com/articles/visibility/
I can’t seem to find help to make something similar in Unity and code in the article is too hard to read for me.
Can someone make sample code or perhaps give me a link to tutorial?
Edit: The picture I attached is bad… It would be better to show the player walls and stuff instead of just black.
Well, why not just use a first-person view? Then you automatically can’t see anything that can’t be seen from the player avatar’s position.
It’s certainly possible to do ray-casting to selectively show/hide stuff even in a top-down view… but it’s a lot more work, and less intuitive for the player.
“Why not just use a first-person view”
What do you mean? I don’t want to make FPS if that is what you mean.
If you mean combining some cameras and having the main camera show only stuff that other cameras see then how can I make something like that?
You could certainly make a fake by putting your only light source on the player. You might even be able to use a shader to get a more sophisticated version of the effect. No point rewriting the entire raycasting thing when Unity’s lighting model already handles it.