|
hi, I am working on a characted editor and I want to separate the scene from the background. the editor has got different views and I need the same background in any of them. my idea was to simply add a flat 2D image to the game camera background (whatever Im using each time). I thought it would be much easier but I cant find out how to do it properly. the closest Ive been is having a camera for the game scene and then create a 2nd camera whith a skybox in a separate layer but I cant set it up as non depth camera. in any case, is there any way to simply add a flat image as background no mather which camera, view, perspective I have?? Thanks a lot!!
(comments are locked)
|
|
You're almost there, with the 2nd camera approach. Here's how to do it:
Voila, this should give you your GUI Texture rendered by your background camera, behind everything else rendered by your main camera. And for any other additional cameras (eg, other camera angles) that you want to use, just repeat the last two steps on them. thanks for this Duck, I was looking for the same thing. Query though, is there anyway to stop the clipping for a full background image when aspect ratio is changed?
Mar 23 '10 at 12:31 PM
RobF
It's much better if you set all the pixel inset values to 0, and set the scale to (1, 1, 1) instead. Otherwise, the background image doesn't adapt to different screen sizes. The only possible drawback is that the background image will get stretched or squished with different aspect ratios than the one you used to create the game. If this is not desirable, you can use a script like this one: http://www.unifycommunity.com/wiki/index.php?title=GuiRatioFixer
Apr 21 '10 at 11:16 PM
Eric5h5
In 3.2, when I do all the above, the 'background' image is drawn really as a 'foreground' image in the Editor, all my other geometry behind the texture. I changed 'depth', no help. Anyone?
Feb 28 '11 at 09:21 PM
DaveA
This solution works excellently. My only problem is when I go to actually make the background scroll, it stutters every now and then as it moves. I am adding an offset*Time.deltaTime every update to the pixelInset.x. Is there a better way to make the background scroll? Code is below. function Update () { var xVel : float = -xVelocity*Time.deltaTime; background1.pixelInset.x += xVel; background2.pixelInset.x += xVel; }
Aug 25 '11 at 05:06 PM
paulg568
I had the same problem as DaveA. I finally realized that while my BG camera's culling mask was set correctly, my actual BG image was assigned to layer Default and not layer BackgroundImage. That step is listed in the instructions but I must have accidentally skipped it or messed it up.
Feb 28 '12 at 04:51 AM
AbePralle
(comments are locked)
|
|
A very simple solution add a plane with background texture as child object to the camera so it will always keep the same position relative to the camera. Move the plane close to the 'far clipping plane' distance. Liked and used! A really fast way to set up a static background! (I would suggest a directional light too to make it look... brighter! :D)
Apr 11 '11 at 02:42 PM
FrHaYwOrKs
Ist not the moste stable but the easyest background images setup, works fine for me.
May 17 '11 at 10:57 AM
Malzbier
(comments are locked)
|
|
in perspective view i have solid color for a BG. BG texture not working :/ why?
(comments are locked)
|
