- Home /
Set a constant 2d background?
Im making a 2d sidescroller basically. Now, all I want to do at the moment is set a constant background that doesn't move. I know how to display the background(gui texture) but how do i prevent the background from overlapping everything? Thanks!
If you're using a GUI Texture for the background, then no- you don't know how to display the background. GUI Textures are for foregrounds only, since they render on top of everything!
There's no problem with using GUITextures for backgrounds, you just need 2 cameras. There's at least a couple of answers about this already which you can find with a search.
Answer by syclamoth · Dec 01, 2011 at 07:15 AM
Will the camera always be pointing in a single direction? If so, it should be possible to cheat it a little by putting your texture on the inside of a skybox, and using that! Not exactly fantastic for moving cameras, but if the camera is static it should work fine.
It's fine for moving cameras, as long as you don't rotate it on the Y axis.
Answer by Jaeyeonnoh · Jun 25, 2012 at 08:49 AM
two ways.
one is to use another camera with GUITexture with Different Layer and change the cameras' settings of Culling Mask & Clear Flags.
the other is to use a plane with texture with a little of bit scripting. (making the plane to follow main camera's position)
i am currently using the first methods, but on mobile, two cameras will kill the frame rate..
Your answer
Follow this Question
Related Questions
Animated background in multiple scenes 0 Answers
Background/overlay scenes (not layers) : Possible in Unity? 1 Answer
How to set background for 2D game. 1 Answer
GameObject behind the background 0 Answers
How to make background for 2D game 3 Answers