creation of a grid

Hello,

I’m currently working on a game like sim city, now I would like to ask if someone could point me to the right direction on creating a grid for placing the houses etc.

I’ve already searched in the forums, but haven’t found anything about it.

Thanks.

same problem… any ideas?

I don’t think there’s a ready-to-use grid solution for building a city. What I can offer you however is an Editor tool that will allow you to offset many objects at once in increments of units that you can specify. For example, if you knew that every building was 5 units apart from each other, this tool would allow you to easily move these building to 0…5…10…15…etc, without having to type in the XYZ positions in the Transform pane.

Let me know if that helps. If it does, I’ll provide you with the editor script.

I would be interested in the script as well.

The SnapToGrid.cs script on the wiki is a good starting point.

It doesn’t provide realtime snapping, but rather snaps selected objects to the defined grid dimensions through a shortcut key.

Simply place your objects so they’re roughly within the grid that you want them to be, then select them all and apply the script. If you’re creating lots of objects to snap, you might find it convenient to create them as children of a single object - just makes them easier to select in the hierarchy pane.

Installation of the script is easy…paste the script into a new file called SnapToGrid.cs file, create a folder called Editor in your assets and drag the file into that. You won’t need to restart Unity, it should be available immediately.

Unity 2.5 has snapping under “Edit/Snap Settings…”

You hold down the command (control on Windows) key to snap.

169337--6099--$picture_1_298.png

SuperSmart. Will that be in iPhone 1.1? :wink:

No, it will make it in a little further down the road when Unity and Unity iPhone become one app.