How do I hide components in front of my character in a top-down view game?

I realize this discussion is long over, but wanted to add my own solution to problem for posterity’s sake.

It’s kind of tedious, but I use a blank actor class for each level. Then every actor on level 1 is a child of Level1ParentActor class. So when my unit was on level 2, for instance, all actors of class “Level3ParentActor” and “Level4ParentActor,” etc … get set to hidden. When switching to another unit or moving that unit away from level2 all those actors are un-hidden.

This can also be over ridden by UI buttons.

My inspiration was original XCOM games where camera level could be set to show only levels below whatever current camera level was. (Of course camera doesn’t actually change levels, it stays in same place. It’s just a variable used to decide which levels to show/hide.)

From reading comments above, I think I might have done it a bit different, but it worked.

tedious part is ensuring that every actor in map is made from its appropriate parent.

I wonder now if this could be accomplished using level streaming, where entire levels are hidden based on camera’s current level.

1 Like