Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Macro · Mar 26, 2014 at 01:42 PM · terraingridterraindata

Creating tile grid overlays on area (terrain or possibly other objects)

I have checked out some of the current answers but none seem to have a solid answer, they all seem to make some concessions or hack around things to get it working.

Now off the bat I am pretty sure that I will be making each (tile) as a game object, maybe a prefab or something as I will need to interact with it and have some sort of effect to imply it is being interacted with. Then some sort of callback handler for the interactions, however lets put that to one side for the moment, the main point of this block was to show that just having a texture overlay is not what I am after.

I think I have the overall idea of what I need to do, I just dont know that much about terrains in this example, so could do with someone steering me in the right direction.

So I am assuming I will need to get the terrain width/height and multiply it by the size of each tile/chunk in there, or at use some other mechanism, but eventually get the dimensions of the terrain. Then get the size of the tiles being used, and then basically generate a grid of objects in a uniform manner. Now that seems like it should be simple enough, however in the case of slopes and holes is there a way to get the overall normal or angle of slope so I can rotate the tiles in the same sort of way?

Hopefully that all makes sense and someone can chime in with the info I am missing or point me in the right direction.

-- Update --

I have made a simple grid creation editor and script, to create grids and overlay them on whatever is beneath them. However the editor seems to lock up if I do anything major like a grid 200x200 in size (as this would result in 40,000 prefabs created in the scene).

So now the question becomes more how can I handle such large grids in unity without it falling over? I expect I can do something along the lines of limiting it to the screen size and just offsetting it but not sure if anyone has any better ideas or best practices with this? As ideally I want to do sort of build spots in the world, but technically I only need a certain area around the mouse I guess... but I want the tiles in the grid to snap so even if the camera changes the tiles will still be over the same position if that makes sense.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image joedartjr · Mar 27, 2014 at 06:09 PM 0
Share

Are you working in 2D or 3D?

avatar image Macro · Mar 27, 2014 at 10:00 PM 0
Share

It is all in 3d

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can unity stream (endless) terrain from server? 2 Answers

Terrain heightmap isn't smooth 0 Answers

Is there a way to create multiple terrains that use the same settings? (eg textures, grass wind settings) 0 Answers

Why does my tree script not work 2 Answers

Terrain Mesh - Poly Facing... 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges