Hello,
My name is Dean. I got into Unity and C# programming recently to expand my knowledge of video game development. Currently I am trying to make an isometric, construction management based game (think RollerCoaster Tycoon for example) but I am having trouble in snapping the prefabs to a grid.
Whilst it’s great that I’ve achieved this much already with the development of my game, I’m not happy that the placement of each prefab requires precise placement in the game. Each asset is roughly 5’ x 5’ inches, (Floor Tile and Fizz Machine especially) so ideally I want each grid space to be that, at 5’ x 5’.
Also, when building the Floor Tile I would like to know how to “click and drag” a selection so that the path is created quicker, like in the same manner Streets or roads are built in Sim City 4. I think the current placement (having to click and re-click the Floor Tile UI button) of the prefabs for the path is very tedious.
I have the code here for your viewing and assistance.
Any advice on this (or ideally where to go to get my feet wet in my desire) would be fantastic. Many thanks Unity community.
Dean.
@AcidicPaper, hi there. yeah snapping prefabs is easy to do. I suggest that your models (if you made them yourself) are set to the origin (0,0,0) before you export them to an .FBX, then once you have them in Unity, while you are in the transform tool, hold ‘v’ to access vertex snapping. it will allow you to snap the vertices of two objects together. hope this helps!
@Ho-Runner Hi! Thanks for your speedy reply!
The objects in question were made by myself in SketchUp. So, will I need to place them at the 0,0,0 origin before putting them in again?
Keep in mind these are prefabs as well, I dont have them in the hierarchy because the UI is responsible in placing them on the game map.