user3183542
user3183542

Reputation: 196

Screen Rendering in Unity 2D Android Build Glitch?

I have searched both Stack Overflow, and Unity Answers, but I can't find any information on this problem. I have asked a question on unity answers, still awaiting response.

The problem I have is when I build to either Android, or Web, (haven't tried others), there is a black bar on the right of the screen. On android, it is a duplication, 4 times, of a strip of the screen. about 20px wide, and 1/4 of the screen height, quadrupled up the right side of the screen. When I move objects through the area of the screen being copied, it is animated in the side bar. on the Web build it is just black, but should be blue background.

My game is 2D, using orthographic camera.

Please help! I have no idea how to even properly search this kind of problem.

I just did a Web player build in a new test project, and it was fine, so it must be some setting in my game project,

Thanks in advance

Edit.

I also did a build in android with a new test project no problems. Then I created a new project, and copied my game assets and other folders into the project directory. Then the silly glitch happened again. I am at a loss here. Any ideas?

Edit * [Solved] Thank you to Josh, the problem was solved!!!! What was going on was on my mainCamera, the Viewport Rect setting were of. I had the settings as
X=0, Y=0, W=0.975, H=1.

So a bit of the width of the screen was being clipped. I set the settings to the default, X=0, Y=0, W=1, H=1.

And it worked!!!!

this is a picture of the glitch on my HTC One V Android This is the glitch on Chrome Web player, no screen copying, just black, where the background should be blue

Upvotes: 1

Views: 2471

Answers (1)

Josh
Josh

Reputation: 220

Have a look at you camera. The first property is 'Clear Flags'. If that is set to 'Don't Clear' whatever was last drawn in any area of the screen will remain in the next frame.

Try setting it to 'Solid Color', or 'Skybox' and set the Skybox Material parameter in Edit -> Render Settings.

Also, check your camera's 'Viewport Rect' and ensure that it's parameters cover your screen. The default values do this; X=0, Y=0, W=1, H=1.

The aspect ratio of your the window your game is being run within will affect the ratio of your camera's bounds. It's not always the same as the editor window within Unity. You can lock the editor window to a specific resolution or aspect ratio by selecting to dropdown box in the top left of you 'Game' tab within Unity.

Beyond this it's hard to tell what's causing the issue without more information. Are you doing something funky with shaders, multiple cameras or rendering paths?

Upvotes: 4

Related Questions