Sprite cut diagonally in Unity 5

Asked

Viewed 741 times

5

I created a game in Unity 5 (directly for Android) (following the following tutorial) but when I run it on Android the Sprites are cut diagonally as the photo below:

inserir a descrição da imagem aqui

OBS: Unity 5 Environment Testing Goes Perfectly Without Errors.

OBS2: The app was tested on 2 different Androids (4.4.2 and 5.0) (had the error in question).

OBS3: All screens have this diagonal cut.

Main Camera Inspector: Link
Canvas: Link
Button Theme: Link
Button Play: Link
Background: Link
Gamecontroller: Link
Themepanel: Link

Question relates in Unity Answers: Link

Project at Github: Link

The solution given by Gabrielzulian worked but it raised some questions: why cut diagonally ? Shouldn’t it be totally hidden ? because Unity’s Game/Scene screen is normally shown? I also found that this problem does not occur in the version prior to Unity 5.

  • 1

    Hello Ricardo. Dude, don’t take this wrong, but this site is not a forum. Commenting on other questions to draw attention to this is not a very correct procedure. On this question, you have even run the APK in a simulator or other device to make sure that the problem is not in the specific equipment?

  • @Luizvieira On 2 different Androids (4.4.2 and 5.0)

  • 1

    Well, it would be important to edit the question to add that information, okay? Also, post the snippet of the code on which the HUD is mounted. If you make it easier, a lot of people might be interested in helping. You shouldn’t expect them to have the patience to watch the entire tutorial or look in your code where the HUD is mounted to try to find the problem.

  • I’m on vacation, so I don’t have the development environment to even test. But I would say that if the problem isn’t that something is being drawn in front of the HUD, it could be something from the OS version, or the way you package the Atlas (the Tile sheet you use for the HUD components). Try changing this image to do some tests and see if the result changes (because it can help you).

  • @Luizvieira I’m having trouble finding this information you mentioned, where it’s stored ?

  • 1

    Another thing: you checked the information of the existing answer in Unity Answers that you mention yourself? There are some ideas. The check depends on how you assembled the HUD. Is it a Guitexture? You can try reimporting the Tile sheet image (as the response from Unity Answers suggests). It’s within your project.

  • @Luizvieira HUD is the interface of the game? if yes each interface is a scene (Title.)

  • That’s right: https://pt.wikipedia.org/wiki/HUD_(jogo_eletr%C3%B4nico)

  • Hello Ricardo. To be able to help we need to know what you actually did / didn’t do. Could you please post: - the inspector of the components in which this problem appears - properties of the sprites - and the settings of your Android export inside Unity. It could be a print screen. About HUD in Unity: preferably use the canvas, a new scene for each HUD element will overload your memory and give you a headache.

  • Remembering that interface accounts for all the interaction you have with the game, inputs and outputs.

  • Hello @Nils, I added the printscreen of the main inspectors, (I will add the children objects now), there is some way to find the inspectors in code format?

  • 1

    @Ricardo adds the images here in the stackoverflow itself, so users with the same problem can see the images, because they will not be deleted.

  • @Filipemoraes There are many images, they will make the question very extensive (I will add more soon), but to perpetuate the images I will be sending them to github and exchange links.

  • 1

    @Ricardo the images will not make the question extensive, they are a help to those who will help you, including stackoverflow encourages this practice.

  • I don’t know if it’ll help, but have you tried increasing the "order in layer" of the cavas? Also try to disable your background and compile for Android without it, to see if the problem persists. I think your background is causing the problem.

  • @Filipemoraes this change has not solved :- <

Show 11 more comments

1 answer

2


The problem seems to be related to the Z axis of your background. Try to put the Depth position (Z) of it to 1.

  • It worked but why cut diagonally ? Shouldn’t it be totally hidden ? because Unity’s Game/Scene screen is normally shown?

  • I also found that this problem does not occur in the version prior to Unity 5

Browser other questions tagged

You are not signed in. Login or sign up in order to post.