I want to use a second camera to draw my character into a render texture. And whatever I set the background colorsI always get the texture that is my character with white background colors. How can I set my background colors to be transparent,and only show my character in the texture, which for my the GUI Showing. Thanks! And Sorry for my poor English!
I think you want to set the Clear Flags of the RT Camera to not clear everything. This should only make it draw your character, and not the background, too.
Each Camera stores color and depth information when it renders its view. The portions of the screen that are not drawn in are empty, and will display the skybox by default. When you are using multiple Cameras, each one stores its own color and depth information in buffers, accumulating more data as each Camera renders. As any particular Camera in your scene renders its view, you can set the Clear Flags to clear different collections of the buffer information.
I’ve had problems with this and one issue is that some shaders have a Colormask of RGB only, not RGBA. Certainly you need to start with clear flags of SolidColor and the color having alpha of zero.
In my specific case, I also rendered my camera twice, once with a custom replacement shader that only wrote to alpha channel, but you might not need this, depending what shaders you are already using.