Can't get a full screen background(guiTexture).

Hello,

I need to have a fullScreen screen, and a background image.

The game will be played on a fullHD screen.
I have my background image (1920x1080), my guitexture position (0,0,0)

and pixelinset values as:

backgroundGUITexture.pixelInset.width = Screen.width;
backgroundGUITexture.pixelInset.height = Screen.height;
backgroundGUITexture.pixelInset.x = 0;
backgroundGUITexture.pixelInset.y = 0;

well its simple as that, but I get this (check the attachment).
As you see the blue(unity default background) appears on the top and right.
What might the reason be?

maybe it's not stretching your texture but strange because I think than it would have to be gray not blue

@sdgd how does it stretch my texture or what might be the reason?

1 Answer

1

Well got to a solution :slight_smile:

instead of:

backgroundGUITexture.pixelInset.width = Screen.width;
backgroundGUITexture.pixelInset.height = Screen.height;

I did put:

backgroundGUITexture.pixelInset.width = Screen.currentResolution.width;
backgroundGUITexture.pixelInset.height = Screen.currentResolution.height;

You should use comments to reply, rather than creating a new answer that doesn't contain an answer. ;) Mass alone won't solve the problem - it will make the sliding smaller, but not zero, so it can still build up over time. Having drastically different masses collide can sometimes result in unexpected physics behaviour too. Did you try the configurable joint? I just made a test scene and it worked perfectly - much better than mucking with velocities. I'll add the settings I used, in case that helps.