Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Feature Request help to create 3 match unity2d

Discussion in '2D' started by ALidskiy, Oct 19, 2023.

  1. ALidskiy

    ALidskiy

    Joined:
    Jun 27, 2023
    Posts:
    4
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    37,112
    You need a way to author that shape, eg, some way to put data into your program that is used to decide where and what to spawn.

    There's a million different ways ranging from hand-typing all the coordinates one cell at a time, or making a function that generates positions as you like, up to making a complete interactive game editor.

    If you want a simple example of using a texture to spawn stuff, I have such an example in my MakeGeo project.

    Look for the
    Bitmap2Grid
    scene and associated code.

    MakeGeo is presently hosted at these locations:

    https://bitbucket.org/kurtdekker/makegeo

    https://github.com/kurtdekker/makegeo

    https://gitlab.com/kurtdekker/makegeo

    https://sourceforge.net/p/makegeo
     
  3. roxter08

    roxter08

    Joined:
    May 3, 2019
    Posts:
    4
    I am assuming your game is in 2D perspective.
    For a pyramid I guess you can use a simple 2D for loop to spawn your gems in a triangular shape

    An hour glass is also just two triangles mirrored.

    For any other complex shapes you can try the hand typing coordinates method or the other methods mentioned by @Kurt-Dekker
     
    ALidskiy likes this.