Search Unity

2D Terrain Editor

Discussion in 'Assets and Asset Store' started by V0odo0, Mar 3, 2014.

  1. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328

    This asset will generate dynamic 2D Terrain mesh for your game. Edit heightmap right in Editor SceneView trough curves, or generate it in Runtime trough API. Great solution for mobile 2D platformer or racing games.
    • Compatible with all platforms
    • Strongly optimized using Advanced Mesh API and Job System with Burst integration ready
    • Optional Modules based on your needs
    • Full Editor Undo / Redo support
    • Well organized and commented source code without custom dependencies
     
    Last edited: Apr 16, 2021
  2. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    This package is now avaliable in Asset Store!
     
  3. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Hi V0odo0, sent you a PM
     
  4. fidelsoto

    fidelsoto

    Joined:
    Aug 7, 2012
    Posts:
    87
    Greetings V0odo0, I have a question before I make a purchase: Can I use this tool WITHOUT colliders? Is there an option to disable everything related to the colliders? In case there isn't, is it easy enough for me to go into the source code, comment out a few lines and have it working without colliders? Thanks in advance!
     
  5. Aldo

    Aldo

    Joined:
    Aug 10, 2012
    Posts:
    173
    Does the package comes with the vehicle?
    I am interested in it but I would like the vehicle too.
     
  6. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Sure, you can remove collider from terrain. For make it just delete or comment all code lines that contains EdgeCollider2D component in TerrainEditor2D.cs and TerrainEditor2DIns.cs scripts. After that you can remove EdgeCollider2D component from your terrain.

    Unfortunately not, this package does not include 2D Vehicle. Check out 2D Vehicle Physics package in Asset Store.
     
  7. Robs

    Robs

    Joined:
    Jan 12, 2014
    Posts:
    5
    I am running into the following build error using 2DTerrainEditor:

    Assets/2DTerrainEditor/Scripts/TerrainEditor2D.cs(1,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?

    The game runs fine in the editor, it only seems to be happening when I try to build. Does anyone know what could be causing this?
     
  8. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Please, make sure that the TerrainEditor2DIns.cs script is placed in Editor/ folder. Also, TerrainEditor2D.cs is not an editor script, if you changed it before make sure that the TerrainEditor2D class is type of MonoBehaviour.
     
  9. biscito

    biscito

    Joined:
    Apr 3, 2013
    Posts:
    138
    hi can i use it with 3D colider ?
     
  10. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Unfortunately not. Only 2D collider.
     
  11. Cain13

    Cain13

    Joined:
    Nov 20, 2012
    Posts:
    1
    Hi V0odo0,
    I just bought this package ... it works fine but when compiling for android gives me this error.

    Assets/2DTerrainEditor/Scripts/TerrainEditor2D.cs(1,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?

    I tried what you mentioned above are but do not really understand ... you could tell me I can do ...
    Thanks and sorry for my English is make by google translate.
     
  12. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    hi here i got terrain edge collider not refresh after randomization

    i say nothing ! just missing line at 360

    UpdateCollider();
     
  13. VBsec

    VBsec

    Joined:
    Aug 1, 2014
    Posts:
    7
    Bought, so far very satisfied.
     
  14. Nicolas-Wenk

    Nicolas-Wenk

    Joined:
    Oct 31, 2014
    Posts:
    1
    Hi V0odo0, The plugin seems very good. I'm actually interested by the API for the runtime generation. Before I make a purchase, I just wanted to know more about it. Have you some documentation and/or complete example ?

    Thanks in advance!
     
  15. nadem840

    nadem840

    Joined:
    May 21, 2014
    Posts:
    1
    Assets/2DTerrainEditor/Scripts/Editor/TerrainEditor2DIns.cs(165,28): error CS0117: `Camera' does not contain a definition for `current'

    how i can fix this
     
  16. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Camera.current is the variable of Camera built-in class. Make sure that your project is not contains another class with the same name.

    Hi. At the moment this aspect is not documented well. Package contains example script with comments about how to use runtime generation. Detailed documentation will be available along with next package update.
     
    Last edited: Jan 5, 2015
  17. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    I did not quickly responded in this thread. Sorry for that. New update with some fixes is coming this week.
     
  18. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Version 1.1 is avaliable!

    Fixes:
    * SavedMeshes folder is now will be found automatically so you can move package to any other folder in your project
    * Selected Editor tool at now is not affected to object in Edit Terrain mode
    * Brush circle is now renders correctly

    Improvements:
    * In addition, now you can also generate 3D collider for terrain
    * Added noise parameter for brush
    * Added layers option
    * Undo command is now supported
     
  19. Darioszka

    Darioszka

    Joined:
    Jan 22, 2015
    Posts:
    12
    there is sorting layer but don't work in my 2d project
    ?
     
  20. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Hi. Sorting layer and layer order are set on the start in runtime. If that not happens for any reason try to set sorting layer and layer order to MeshRenderer component manually via script.
     
  21. RickMo

    RickMo

    Joined:
    Jan 30, 2014
    Posts:
    1
    Hi V0odo0

    I've sent you a PM.

    Thx,
    Ricky
     
  22. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    New verison available! There was a problem with falling 2D objects through terrain. Fixed by replacing Edge collider to Polygon collider.
     
  23. Santosh-Patil

    Santosh-Patil

    Joined:
    Apr 1, 2013
    Posts:
    7
    Hi V0odo0,
    The plugin seems very good. But i'm not able to sort the layer of terrain and my sprites. Terrains sorting layer is always set to behind the sprites. i want it to move it to front. I've change the sorting layer manually in script but no effect. Cap sorting layer is set to above the sprite.
     
    Last edited: May 2, 2015
  24. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    I will check what's wrong with the layers. Thanks.
     
  25. Santosh-Patil

    Santosh-Patil

    Joined:
    Apr 1, 2013
    Posts:
    7
     
  26. Santosh-Patil

    Santosh-Patil

    Joined:
    Apr 1, 2013
    Posts:
    7
    Hey voodoo when will get the solution for this issue. I'm already waited for 15-16 days, it's urgent.
     
  27. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Sorry for the late update. Problem with the layers solved and updated version of this asset will be in Asset Store soon.
     
  28. mtsanchez10001

    mtsanchez10001

    Joined:
    Oct 15, 2015
    Posts:
    7
    hi there, I just bought the asset and I can´t modify the terrain.
    I enter to edit mode and press D + left mouse button, but happens as if i were touching only the left mouse button.
    I have unity 5.2
     
  29. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Hi. I just tested it in Unity 5.2.1f1 and lower terrain mode works fine by using D + left mouse button. Maybe you should try to check it again in empty project.

    If nothing helps, take a look at #334 code line in TerrainEditor2DIns.cs script. There you can change the hotkey from D+LMB to anything else.
     
  30. mtsanchez10001

    mtsanchez10001

    Joined:
    Oct 15, 2015
    Posts:
    7
     
  31. mtsanchez10001

    mtsanchez10001

    Joined:
    Oct 15, 2015
    Posts:
    7
    thanks, works when i re open the proyect.
    I have another question:
    is there a way to generate always the same terrain at runtime? something like a perlin noise implementation?
     
  32. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Major update!

    Features:
    * Smart cap feature added. It allow to automatically split cap into different paths depending on hills height
    * Added realtime deformation feature
    * Extra five cute hand painted tile textures added
    * Added description to most methods and variables in main class
    * Added color options for terrain and cap
    * Added possibility to change sorting layer and order for cap
    * New brush option: Height limit
    * New hotkeys:
    [F1-F4] - Switch inspector tab
    [Shift+Z / Shift+Y] - Undo/Redo in edit mode
    Hold [Alt+Ctrl+Mouse wheel] - change brush size (accelerated)
    Hold [Shift] - brush horizontal lock in edit mode

    Fixes:
    * Undo/Redo and Copy/Paste commands is now working properly
    * Optimization and code refactoring
    * Collider type changed from Polygon Collider 2D to Edge Collider 2D
     
  33. trudeaudm

    trudeaudm

    Joined:
    Apr 17, 2013
    Posts:
    116
    Is there any way this could be used to make or generate circle terrains for a small planet or something similar?
     
  34. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Hi. Unfortunately no. This asset is not what you are looking for.
     
  35. jahnotto

    jahnotto

    Joined:
    Feb 2, 2016
    Posts:
    2
    Is it possible to increase the size of the terrain? I need a really long terrain, but I don't want to generate it automatically (I need to hand paint it). Do I need to make multiple terrain objects and manually make them fit together?
     
  36. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Yes, you can adjust terrain width and height values. For really long terrain I'd recommend to separate it into different objects. Fix sides option will help you with it.
     
  37. Chris110

    Chris110

    Joined:
    Feb 25, 2014
    Posts:
    3
    Hey Voodoo, thanks for this Asset mate, it works really well for what I want.. I was wondering though, is there any way I could turn the edge collider into a polygon collider? (maybe optionally?) - I want to prevent things being "inside" the ground. (i.e. when I spawn an object, I want to detect if it's "below the surface" and move it upwards until it isn't)
     
  38. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Hi. Unfortunately there is no option to do this from inspector. So if you want to use Polygon Collider 2D instead of Edge collider 2D you need to do following things:
    1. Uncomment region at 263 code line and comment region at 247 code line in TerrainEditor2D.cs script.
    2. Change EdgeCollider2D to PolygonCollider2D type at 9 code line in TerrainEditor2D.cs script.
     
  39. Chris110

    Chris110

    Joined:
    Feb 25, 2014
    Posts:
    3
    Awesome, thanks Voodoo, I'll give that a try and let you know how it goes :)


    Edit: Brilliant! Works perfectly... Thanks for the help,

    I have another question, but I need to investigate it a bit further first to make sure I'm not doing something stupid. :)
     
  40. kmsjkh

    kmsjkh

    Joined:
    Jan 31, 2016
    Posts:
    14
    Can I deform terrain smoothly?
    not angularly

    i want to make tarrain smoothly like Bruch of Terrain Editor EDIT MODE in realtime
     
  41. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Yes, you can. But you need to know that the whole shape of 2D collider is also updates with each deformation call, not only mesh as its works in edit mode. it is very expensive operation and most likely will give low FPS while calling deformation in every frame.
     
  42. Meizi-Games

    Meizi-Games

    Joined:
    Nov 27, 2014
    Posts:
    4
    I am using older version of this asset and time to time some objects fall through terrain. I tried to change Edge Collider 2D to Polygon Collider 2D and that change most likely fixes that problem, but our game took huge performance hit so that option is not suitable for our game. Is there any other tricks which could prevent objects falling thru terrain and which not cause lot performance issues?
     
  43. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    Will this asset get an update for Latest Unity 5.6 and Unity 2017 or the current version is good and ready to work with latest Unity ?
     
  44. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    Hi. There is no Unity version specific things in this asset except of a few deprecated editor functions. Just tested it in 2017.1 and all works fine.
     
    zero_null likes this.
  45. cratica

    cratica

    Joined:
    Dec 11, 2016
    Posts:
    59
    Hello I purchased this a while back and now am running Unity3d on a MacBook Pro. The issue I am having is that when in EDIT MODE, the cursor deforming the terrain is WAY offset from my mouse cursor so its impossible to use. For example, if the large circle for edit mode is in the center of the Scene Window, my actual mouse cursor is on the far right bottom (inside the inspector panel). I cannot progress until there is a fix for this. Please advise asap. Thank you.
     
  46. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    First off, make sure that scene view camera is in 2D or orthographic mode. Nonzero terrain transform rotation may also be the reason. Test the asset on clean project to exclude possible conflicts with third party assets.

    If that is not your case please send me more details with some screenshots and your Unity editor version.
     
  47. cratica

    cratica

    Joined:
    Dec 11, 2016
    Posts:
    59
    Hello, after spending 5 days building a level for my game, I accidentally hit the "apply" button which instantly destroyed 5 days of work. Really, REALLY bad design that there is not a "sure you want to do that?" or "undo". Anyhow, I have tried to copy the terrain files from a previous days backup but that is not working. I can see the correct 2d collider outline but the terrain texture is not there. How can I copy files from a backup so it will work properly? Thank you.
     
  48. cratica

    cratica

    Joined:
    Dec 11, 2016
    Posts:
    59
    As for the offset editing circle, its a pain in the rear as I have to constantly move my terrain to the top left of scene view and keep my cursor in the bottom right to edit. My large scene (that got deleted as noted above) is 10,000 units long so any help getting both these issues resolved would be wonderful. The scene view camera is in 2d, the terrain transform rotations are at 0. I have tested on a clean project and it still does this. It does this on the Macbook AND Windows 10 now. I have tried versions 2019 through 2020.2.1f1. All of them exhibit the offset.

    Here are images. If you move the cursor to the top left, the editing circle is directly on it. The further you move away from the top left, the worse it gets. (the further apart the cursor is from the actual editing circle)

    IMG_3868.jpeg IMG_3872.jpeg
     

    Attached Files:

  49. cratica

    cratica

    Joined:
    Dec 11, 2016
    Posts:
    59
    As for losing the terrain and trying to copy files from a previous backup, I have tried copying just the terrain files, the entire 2D terrain directory and even renaming the backup files the same as the files that the current version is using. All methods resulted in the same problem. I can see the 2D collider and that works fine BUT the texture is not drawn. You can see what this looks like in the image below. How can I successfully restore/copy 2D terrain from a previous backup?

    Screen Shot 2021-01-07 at 1.11.05 PM.png
     
  50. V0odo0

    V0odo0

    Joined:
    Jan 8, 2012
    Posts:
    328
    As I can see on the screenshot your mesh filter component somehow has a missing reference to terrain mesh. 2D terrain component works directly with the mesh that is by default stored as asset inside 2DTerrainSavedMeshes folder. You need to find and manually reassign it to mesh filter.

    It is a definitely bad design that you cannot undo changes made by randomizer. It will be reworked. For now, I can only apologies for time you wasted on this.

    I will look into the issue with circle offset and let you know.