playMaker

Author Topic: Making the roof invisible in a top down 2D pixel game that has multiple floors.  (Read 1103 times)

aeroW45

  • Playmaker Newbie
  • *
  • Posts: 8
Hello everyone.

I am working on a 2d top down pixel game, everything is still very early in development. A good example of what i am trying to do would be something in the style of 2D Zelda games, such as A Link To The Past or Link's Awakening.

My issues are as follows. How do i make the roof of houses transition into invisible when the character goes inside them, so the character is visible to the player while inside the house? How would i do the same thing if said house has multiple floors? When the player goes inside a house i want to have only the current floor be visible without the need of loading in a new scene. So the character would go inside the house while the roof and floors above transitions to invisible. Then the character would go up the stairs and again the camera would follow without a loading screen and show the current floor.

Eventually i also wanna have underground areas, but i assume the technical aspects of having the camera follow the player underground or up a floor are the same. Since its just the player going from one layer to another, no?

I cant seem to find much information on such a thing? I have read things on camera culling, 2draycast and layers but i cant quite understand it. If anyone could point me in the right direction or give me the basics of making a roof invisible, i would appreciate it.

I am using Unity 2018.2.14.f1, Playmaker 1.9.0.p4. and ProCamera2D.

Thank You.

Athin

  • Full Member
  • ***
  • Posts: 163
I'm not able to test/try this due to not being home but what I'd try is this.

Have a collision box on the inside of the house.  When the player enters it, set the material of the roof or ceiling transparent.  When they leave just simply return it to normal.