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

Question How to set GameObject tile to tilemap through script

Discussion in '2D' started by benjamin01729, Oct 21, 2023.

  1. benjamin01729

    benjamin01729

    Joined:
    Jan 6, 2021
    Posts:
    1
    Sorry if this is in the wrong place, I am new to the forum and Unity.

    I know that I can use GameObject Brush to put 3d objects onto a tilemap, but how would I do this through scripting?
    I see the SetTile function but how would I create a tilebase using a gameObject?
    If anyone has any example or anything it would greatly be appreciated.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,084
    I think you would just instantiate the game object at the appropriate location like normal.