r/Unity2D • • 3h ago

Question/Help How to turn each pixel on a colour map to a tile on a tile map?

1 Upvotes

I followed this tutorial: https://www.youtube.com/watch?v=RDQK1_SWFuc&list=PLFt_AvWsXl0eBW2EiBtl_sxmDtSgZBxB3&index=4 I just finished ep4 and the next episode goes into generating a mesh from the perlin noise. I want to make a 2d game and have a tileset already set up. What I want to know is how to transfer each pixel on the colour map to a corresponding tile in the tileset and then draw that on the tile map.

I've already defined what tile should be used for each terrain type.

public struct TerrainType
{
    public string name;
    public float height;
    public Color colour;
    public RuleTile tile;
}

How do I then use each pixel on the colour map to place it's tile on a tilemap? This is the first time I've none proc gen so I have absolutely no idea: talk to me like I'm a complete beginner.


r/Unity2D • • 16h ago

Question/Help How to stop clipping?

1 Upvotes

I realize this is probably a pretty simple question but I'm new can't find the answer anywhere. My characters keep clipping into each other when turning around. I can't figure out how to add the video of it but this is the code I'm using: transform.localScale = new Vector2(Mathf.Sign(movement2.x), 1);


r/Unity2D • • 18h ago

Question/Help Can someone help me?

Thumbnail
gallery
0 Upvotes

I am trying to create a timing-based precision game that includes scoring and misses, but when I press the spacebar within the "danger zone," the game registers it as a successful hit on the target.