If My Player Walks into a 3D "building" in a top view game, How would I get the Roof, or rest of the buildings stories, to become invisible?
Plain and simple question. I work with C# I'm not asking for code, point me in the right direction and I'll teach myself. Please and Thank You!
Answer by Cherno · Apr 14, 2016 at 10:20 PM
Make each floor a seperate gameobject. Then, find out if the player entered the building, with a trigger collider for example. Then, access the Renderers of all higher floors and and set the color of their materials to have an alpha value of 0 (useful with Math.Lerp or Color.Lerp to get a smooth fading effect), or just disable the renderer components altogether.
Thanks. Im actually switching over to 2d, it's much easier for me. But that sounds like it would work but idk how to make it the Answer, but thanks anyways!
Answer by toorican · Nov 15, 2021 at 02:56 PM
Hi If your still looking for a solution check our Asset as this is custom made shader for this use case. It can handle multi user multi buildings ( obstructions ) and is available for Standard URP and HDRP .
https://forum.unity.com/threads/rel...isible-within-buildings-std-urp-hdrp.1182130/ https://assetstore.unity.com/packages/vfx/shaders/see-through-shader-193955 https://www.youtube.com/watch?v=9X9aVJzzBlI
Greetings Toorican
Your answer
Follow this Question
Related Questions
Make everything above the floor my player is standing invisible when my camera cant see my character 0 Answers
Make 3D object point to cursor 0 Answers
Player keeps spinning after collision 0 Answers
Animation layer plays animation in wrong direction 0 Answers
Top down 3D shooter - mouse aim 0 Answers