Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How would you separate your 3D terrain into different areas?

Discussion in 'General Discussion' started by chaikadev, May 22, 2020.

  1. chaikadev

    chaikadev

    Joined:
    Nov 9, 2019
    Posts:
    6
    I want to separate the terrain of my RTS game into areas like forests, fields and roads. These areas are more than for aesthetic purposes since they will affect gameplay like by changing a unit's speed. I can't use tags or layers directly on the terrain because multiple areas will be on the same object. I can't use the polygons on unity's navmesh because I made my own pathfinding system.

    What would be the best way to define the areas on my map? I thought of two options but tell me if you have something better in mind.

    1) Painting different textures with each one representing an area type.

    2) Creating a new mesh with each polygon being a node with the area's information.

    Let me know what you think, any sort of input is greatly appreciated. Thank you!
     
  2. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    You could do a giant trigger box collider on an empty object. OnTriggerEnter/Exit or OnTriggerStay set your biomeVar = Forest or Desert or something.
     
  3. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    We use A* Pathfinding project but we have painted info ontop of the navmesh for stuff like that

     
    ClaudiaTheDev likes this.