मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग6.6k · #13851

unity-tilemap-2d

यह क्या करती है

यह स्किल बताती है कि Unity 6 में 2D टाइल मैप कैसे बनाएँ और उन्हें स्क्रिप्ट कैसे करें। यह टाइल इमेज से 2D लेवल बनाने वाले डेवलपर्स के लिए है।

कब इस्तेमाल करें

  • ✓जब आप Unity में Tile Palette से 2D लेवल पेंट करना चाहें।
  • ✓जब टाइल में टक्कर चाहिए, या Rule Tiles से अपने-आप जुड़ने वाले किनारे चाहिए।
  • ✓जब आपको गेम चलते समय टाइल बनाने या बदलने के लिए स्क्रिप्ट चाहिए।

Skill का लिंक

https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/unity/unity-tilemap-2d/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/unity/unity-tilemap-2d/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे Unity में 2D प्लेटफ़ॉर्म लेवल पेंट करने में मदद कीजिए और खिलाड़ी के लिए दीवारों को ठोस बनाइए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह ग्रिड और टाइलमैप सेट करना, मैप में टक्कर जोड़ना, स्वचालित किनारों के लिए rule tiles इस्तेमाल करना, और कोड से टाइल बदलना समझाती है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Unity 2D Tilemap

Author and script tile-based 2D levels in Unity 6.3 LTS with the Grid/Tilemap system, the Tile Palette, colliders, and runtime painting. Targets Unity 6.3 LTS (6000.3).

Package note: the core Tilemap (Grid, Tilemap, Tile, TilemapCollider2D) is built in, and so is the Tile Palette with its default brush. Rule Tiles, Animated Tiles, and the extra brushes (Random, Line, GameObject, Group) live in the separate "2D Tilemap Extras" package (com.unity.2d.tilemap.extras, 6.0.x for Unity 6.3) — install it via Package Manager before using RuleTile.

When to use

  • Use when laying out a 2D level by painting tiles, setting up a Grid + Tilemap, adding collision to the map, using auto-tiling Rule Tiles, or generating/editing tiles from script.
  • Use when scenes contain a Grid with Tilemap children, or *.asset tile/palette files.

When not to use: level design practice (pacing, blockout, layout principles) → level-design. 3D tile/grid placement → Unity's own 3D tooling (ProBuilder / grid brushes; no dedicated skill here). The platformer character that moves over the tiles → platformer / unity-physics.

Core workflow

  1. Create the grid: GameObject → 2D Object → Tilemap → Rectangular (the Grid's Cell Layout also offers Hexagonal and Isometric for hex/iso levels). This makes a Grid with a child Tilemap (+ TilemapRenderer). Use one Tilemap per layer (background, ground, foreground) and set each renderer's sorting.
  2. Open the Tile Palette (Window → 2D → Tile Palette), drag in a sliced sprite sheet to create Tile assets, then paint with the brush tools.
  3. Add collision to the solid layer: TilemapCollider2D. For one merged collider (far cheaper and gap-free), also add CompositeCollider2D (+ a Rigidbody2D set to Static) and set the tilemap collider's Composite Operation to Merge.
  4. Auto-tile with Rule Tiles (2D Tilemap Extras) so edges/corners pick the right sprite automatically instead of hand-placing every variant.
  5. Edit at runtime via script with cell coordinates (Vector3Int): SetTile, GetTile, SetTilesBlock, converting world↔cell with the Grid/Tilemap.
  6. Verify in Play mode: confirm collisions (Physics Debugger), sorting order, and that RefreshAllTiles ran after bulk edits.

Patterns

1. Painting tiles at runtime (cell coordinates)

using UnityEngine;
using UnityEngine.Tilemaps;

public class TilePainter : MonoBehaviour
{
    [SerializeField] private Tilemap tilemap;   // assign the target Tilemap
    [SerializeField] private TileBase groundTile;

    // World position -> cell, then place a tile.
    public void PaintAt(Vector3 worldPos)
    {
        Vector3Int cell = tilemap.WorldToCell(worldPos);
        tilemap.SetTile(cell, groundTile);
    }

    public bool IsSolid(Vector3 worldPos)
        => tilemap.GetTile(tilemap.WorldToCell(worldPos)) != null;
}

2. Bulk fill a region (faster than per-cell SetTile)

// SetTilesBlock writes a whole BoundsInt in one call — use it for procedural rooms/floors.
public void FillFloor(Tilemap map, TileBase tile, int width, int height)
{
    var bounds = new BoundsInt(0, 0, 0, width, height, 1);
    var tiles  = new TileBase[width * height];
    for (int i = 0; i < tiles.Length; i++) tiles[i] = tile;
    map.SetTilesBlock(bounds, tiles);
}

3. Clearing and refreshing

tilemap.SetTile(cell, null);   // null erases the tile at that cell
tilemap.RefreshTile(cell);     // re-evaluate just this cell's rule/animated neighbors (cheap)
// RefreshAllTiles() re-evaluates the ENTIRE map — reserve it for full regenerations, not per-edit.

Pitfalls

  • RuleTile type not found — it's not built in. Install the 2D Tilemap Extras package (com.unity.2d.tilemap.extras) via Package Manager.
  • A collider per tile tanks performance / leaves seams — add a CompositeCollider2D with a static Rigidbody2D and set Composite Operation to Merge to merge the whole layer into one smooth shape.
  • No "Used By Composite" checkbox, or an obsolete warning on usedByComposite — Unity 6 replaced it with Composite Operation (Collider2D.compositeOperation). Old usedByComposite = true maps to CompositeOperation.Merge; write that instead.
  • Small gaps remain between merged tiles — raise the Tilemap Collider 2D's Extrusion Factor so
अक्सर पूछे जाने वाले सवाल

क्या Rule Tiles के लिए अतिरिक्त पैकेज चाहिए?

हाँ। Rule Tiles 2D Tilemap Extras पैकेज से आते हैं, जिसे पहले इंस्टॉल करना होगा।

क्या यह लेवल का ढाँचा डिज़ाइन करती है?

नहीं। लेवल डिज़ाइन के सिद्धांत एक अलग लेवल डिज़ाइन स्किल में कवर हैं।

क्या यह 3D ग्रिड कवर करती है?

नहीं। 3D टाइल प्लेसमेंट इस स्किल से बाहर है।

जानकारी

लेखक का मूल विवरण

Build and script 2D tilemaps in Unity 6.3 LTS: the Grid + Tilemap components, the Tile Palette, tilemap colliders, rule tiles, and runtime SetTile/GetTile painting. Use when painting tile levels, adding a TilemapCollider2D, using rule or animated tiles, generating tilemaps from code, or when the user mentions Unity tilemap, tile palette, rule tile, or Grid.

repo: gamedev-skills/awesome-gamedev-agent-skills

लोकप्रियता

GitHub स्टार
6.6k
रैंकिंग में स्थान
#13851
लाइसेंस
Apache-2.0
अपडेट की गई
28/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

router

6.6k

यह आपके एजेंट को इंजन और काम के प्रकार को पहचानकर किसी अनुरोध के लिए सही गेम डेवलपमेंट स्किल चुनने में मदद करती है।

कोडिंगसामान्य कोडिंग

ai-behavior-trees-utility-ai

6.6k

यह आपके एजेंट को दुश्मनों और किरदारों के लिए बिहेवियर ट्री और यूटिलिटी AI सिस्टम बनाने में मदद करती है, जो प्राथमिकता और स्कोर से कार्रवाई चुनें।

कोडिंगसामान्य कोडिंग

audio-design

6.6k

आपके एजेंट को गेम ऑडियो मिक्सिंग सिखाती है: बस, डेसिबल में वॉल्यूम, डायलॉग में म्यूज़िक धीमा करना और साउंड इफ़ेक्ट की विविधता।

वीडियो और ऑडियोऑडियो और आवाज़

camera-systems

6.6k

यह आपके एजेंट को ऐसे गेम कैमरा बनाने में मदद करती है जो सहजता से पीछा करें, लेवल के भीतर रहें, और 3D में घूम या देख सकें।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills