im new to unity and would really appreciate some help.
i have created a 2D TileMap and have each Tile represented in game with a Sprite. it works but my concern is as it grows it will become very inneficient also, the repeating patterns really stand out.
i wanted to know if it is possible to use a larger sprite/image and have it span accross multiple tiles ?
something like the below:
the blue shows tiles that have a reapeating 64x64 pixel image, it works but does not look great
what i’m aiming for this this:
although the tile objects are still there, the end user just sees a 256x128 pixel image, if i then did the below:
the tiles at the end would begin to repeat the image.
as i said, i’m new to this and would appreciate any help
You should be able to change the gap between the cells on the tilemap object. I don’t have Unity right in front of me to confirm this, but I believe the docs are here: Unity - Manual: Creating Tilemaps
(See Adjusting the Grid for Tilemaps). That said, if you are not using a pixel-perfect camera, you will likely see anomalies between sprites.
Here is my code for setting pixel perfect orthographic size:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PixelPerfectCamera : MonoBehaviour
{
public int ppuScale = 2;
public int pixelsPerUnit = 32;
// Use this for initialization
void Start ()
{
double orthoSize = 1f / ((2f / Screen.height) * pixelsPerUnit);
orthoSize = orthoSize / ppuScale;
Camera.main.orthographicSize = (float) orthoSize;
}
}
i appreciate the feedback however, i may not have explained it correctly.
i dont have an issue with there being a gap between tiles, im looking to use a large image to spread across multiple tiles, not a single image that is identical in each tile