How can I optimize my system?

Hello, I am developing a game with an isometric view, problem is when the player enters a building the view is blocked. At first, I just set specific parts transparent with scripts, but when I’m building big things, having to manually list all parts that need to be invisible in a line of code each would be very, very long and tedious. Anyone got any ideas of what to do to optimize this and not have to define every part to set invisible?

  1. When player enters something, make ceiling transparent. And if it has 2+ floors, make them dissapear too until player goes up. To detect such things, either group floors as models, or do loop with raycast.
  2. When player goes behind wall, make it half-transparent. Use raycasts
2 Likes

Raycasting looks interesting, I’ll surely look into it

2 Likes