I have Unity 2D project. When I play it in unity editor, all is ok. But if I build a project and run it as a file, I have problems with sprites - when a character is moving, triangle parts of sprites are disappearing or getting white. How can I fix it?
I've tried to change different settings in the inspector, like wrap mode or other. Also, I added 1px border to sprites, but it did not work. Do you have some advice?
Here is an image of what I have:
https://imgur.com/a/Ft7HahL
Related
I'm creating a Chess game in Unity but I have ran into a problem.
I'm trying to render a Material behind the Chess piece, but instead its rendering In front of the piece.
The Problem
What I've tried
The Material used when I hover my Mouse
The Transparent Material below the Hover Material, when I hover
My URP settings
All the Chess Pieces are Sprites.
How can I get the Material to render behind the Chess Piece?
Please help I've been stuck wondering for a while now.
I'm expecting the Hover material below the Chess Piece, not above.
I downloaded and imported the free tilemap esset but there are vertical lines in the Game screen. The error didn't occur in the Scene screen and even when I had tried building it the game runned without any problem. So, it seems not to be deadly error but it can disturb me while making and testing the game.
I checked the Pixel Per Unit, Filter Mode, and Compression of this tilemap and they were correctly set. I disabled anti-aliasing as well (It worked partially, removing horizontal lines).
While this should resolve the artefact/tearing issue you’re seeing, using a Sprite Atlas is also a good habit to get into even if you’re not seeing the issue anyway.
The Sprite Atlas packs the sprites in such a way that they have a little padding that can stop the texture bleeds that can sometimes cause unwanted horizontal and vertical lines to appear between sprite tiles.
The Sprite Atlas workflow can be read in detail here.
From that documentation, the 3 basic steps are:
Create a Sprite Atlas Asset.
To create the Sprite Atlas Asset, go to Assets > Create > 2D > Sprite Atlas. Unity creates the Sprite Atlas in the Asset folder, with the file extension * .spriteatlas.
Select a list of Objects for Packing into the Sprite Atlas.
The Objects for Packing list displays the currently selected items that are in the Sprite Atlas. You can place Texture2D and Sprite Assets in this list. Drag and drop a folder directly onto the list to automatically add all valid content within the folder to the list (only the folder appears on the list).
Enable Include in build on Sprite Atlases to include them with the project.
I am currently writing a 2D game in unity and whenever I build the actual game, the sprites all disappear, the player is the only thing that remains.
However, the sprites are still there, just invisible. It's not an issue of order of layer and am having trouble fixing it.
I am using SpriteShapeController.
SpriteShapeController auto shows as it having a sprite so it made me think I had a sprite already
I just made Custom Square Sprites and added them in.
I have followed this particular tutorial: https://www.youtube.com/watch?v=ir9Rvi1QG8Y to add a particle system effect on a UI panel. It works well in scene mode and game mode but when built for android no particles are shown. I have tried tweaking the particle shader, material etc.. but to no avail. What do you recommend please? Thanks.
Unity version: 2018.2.11f1
Screenshot1
Screenshot2
After recreating the project myself I've found out that its because of a sloppy code in UIParticleRenderer class.
Shader foundShader = Shader.Find("UI/Particles/Additive");
in line 79
when you try the game in Editor "Find" method works correctly, but when you want to publish it to a device (android) it won't include "UI/Particle/Additive" shader so the shader won't be found.
there are 3 solutions to this problem as described for Shader.Find class in Unity documentation :
reference it from some of the materials used in your scene
add it under "Always Included Shaders" list in ProjectSettings/Graphics
put shader or something that references it (e.g. a Material) into a "Resources" folder.
I used the 2nd solution (which is easier to do) and it solved the problem. so you can go to Edit->Project Settings->Graphics and under "Always Included Shaders" section Add "UI Particles Add", then build and run your project.
Whenever I create a new project in Unity 5 I see this
and I'm not familiar with this scene. The problem is I don't know how to change this scene to this one.
Any solution ?
This means that Unity is in 2D Mode. Click the 2D Button that is next to the Game tab in Unity. That will switch you back to 3D Mode. It is circled in red in the picture below.
And whenever you are creating a new project, make sure to select 3D not 2D and stuff like this won't happen. If it does, click on the 2D button circle in the first image, save scene and exit. That should now be fixed.