Search Unity

How do I place a game object on a tile.

Discussion in 'Scripting' started by mdietz753, Nov 10, 2018.

  1. mdietz753


    Aug 19, 2018
    Hello, everybody,

    I try to place objects on single tiles with the mouse.
    I can display the coordinates of the respective tile with a mouse click (e.g. left click = -8, 13).
    I can click on the item in my inventory and it follows the mouse.
    But I just can't get any further, how can I get the object to be placed on exactly this tile (Sprite changes and a suitable game object is created)?

    If anyone could help me figure out how to connect the Gameobject with my value
    "Vector3Int coordinate" that would help me a lot! :)

    Many thanks in advance!