Search Unity

CODING WITH PROGRID

Discussion in 'World Building' started by vamosfa, Mar 6, 2019.

  1. vamosfa

    vamosfa

    Joined:
    May 15, 2016
    Posts:
    3
    Hi all,

    I am developing a 3d tycoon game. Basically, this genre is a game where you build something (like a city) using a grid. That´s why I am using Pro Grid to do so.

    There is a code question I still did not achieve to solve: how can I make players only be able to place their buildings only in grid holes? I mean, If you as a player are building your city and you want to place a building (maybe a store), how can I as developer code it to ensure that this building fit exactly into a grid hole and not between grids? I need to solve this dude using or not Pro Grid.

    I hope that my explanation is clear enough, if not, think in games like Clash of Clans, Dragon City, etc...All of them work in this way.

    Thanks.
     
  2. MegamaDev

    MegamaDev

    Joined:
    Jul 17, 2017
    Posts:
    55
    ProGrids is for editor use only, unfortunately. The Grid component is the closest any existing component comes, and I doubt it comes with any way to work with 3D objects by default.

    By "between grids," do you mean objects end up on lines instead of between lines? Or do you mean they'll go everywhere, not just the grid holes?

    Try adding a picture of what you have now, and a picture of what it looks like in someone else's game. It'd really help understanding, and faster than words would, at that.