- Home /
Top down house Help
Hi!
I'm planning on making a sort of top down game. I'm wondering about one thing.
As you can see on the image bellow, you are in a house and there's a black background around it. My question is, how do you make a house that you can walk in to and then that black background appears. Do you need to have a new scene or what's the best idea to do here? I already have a script that can teleport you to one location to another, and if I use that to teleport the character to a house, I can't figure out how I'm supposed to have a black background around the room.
Does anyone understand and knows how to do that?
Answer by EvilWarren · Oct 24, 2013 at 11:02 AM
First off, epic moustache on that character there.
Create and set the appropriate layers for the game objects you want to display then just set the camera culling mask to cull everything else when you enter the house. And set the camera backgroundColor to black.
If you're not to sure on layers: http://docs.unity3d.com/Documentation/Components/Layers.html
How to I disable the layers from the camera(s) I don't want to show when I'm in the house? I walk on a trigger that teleports me to a certain point in the house using a teleport script with a fade effect, but do I need to add a line of text in the script which layers I don's want to show on TriggerEnter?
To hide layers:
Camera.mainCamera.culling$$anonymous$$ask &= ~(1 << Layer$$anonymous$$ask.NameToLayer("HideSomeStuffLayer"));
To show layers:
Camera.mainCamera.culling$$anonymous$$ask |= 1 << Layer$$anonymous$$ask.NameToLayer("ShowSomeStuffLayer");
OnTriggerEnter() would be an appropriate place to add it if thats where you switch to this inside house view. Also make sure the mask names correspond to whatever layers you have created and assigned with the tag manager.
Answer by Sisso · Oct 24, 2013 at 11:03 AM
Do like everything else, renderers and colliders. The black area is simple a big mesh with a hole using an black texture that stay between camera and the objects.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Main Menu: Is it better to subdivide it into different scenes? 1 Answer
How to I create an enterable building/ or town scene? 1 Answer
Water Glitch from Near Clipping Plane. 0 Answers
NullReferenceExeption: Object reference not set to an instance of an object. 1 Answer