- Home /
The question is answered, right answer was accepted
Scene Background
How does one go about adding a background, for example I built a starship and wish to put it in front of a large picture of stars.
I've edited the question to remove the AI section, as that has been amply answered on Jack's separate question: http://answers.unity3d.com/questions/11140/creature-behavior
Answer by spinaljack · May 28, 2010 at 01:56 PM
You should post one question at a time to make referencing easier.
For back grounds you can either use a plane with a texture or better use a sky box. You can see an example sky box in the standard assets.
AI is a huge topic and cannot be covered in a single post, try narrowing down which area of AI you're asking about e.g. pathfinding, behavior, decision making etc.
At the most basic level you can simply give the animals a random target to walk towards and then give them a new target when they reach it.
Answer by Puka · Jan 27, 2011 at 07:48 AM
You should create 2 cameras. Name the first one "Main camera", name the second one "Background camera".
- Create a GUI texture (Gameobject->create other->GUITextture), drag your picture from Project to Texture in Inspector panel. Create a new layer (example: star) and assign it to that GUI texture.
- Choose Background camera in Hierarchy. In Inspector panel, set Clear flags to Solid color, Culling Mask -> Nothing and then Culling Mask -> Star (layer)
- Change depth to -1.
- Choose Main camera.
- Set Clear flags to Depth only.
- Culling Mask -> Uncheck "star" layer.
- Change Depth to 1.
Remember to remove Audio listener from the background camera
This is great, thank you. I agree that it would be very beneficial to know why each step is done! If someone could explain, that would be awesome. :)
Follow this Question
Related Questions
How do I use a 2D image as a background in a 3D game? 0 Answers
Transparent shader in background queue 2 Answers
hey a quick question 2 Answers
.avi or .png as background or skybox 1 Answer