Search Unity

How can I create a runtime editor?

Discussion in 'World Building' started by emreyeni999, Nov 14, 2018.

  1. emreyeni999

    emreyeni999

    Joined:
    Jan 24, 2017
    Posts:
    7
    Hey, I need to make a runtime editor in unity like unturned's and euro truck simulator's. It needs to have a road system and object placement system. I have easy roads pro asset maybe I can use it as the road system. if there is an asset which does that I will buy it or if you know something about how to make this please reply.
     
    Last edited: Apr 11, 2020
  2. embeddedt

    embeddedt

    Joined:
    Mar 10, 2018
    Posts:
    36
    Hi,

    I'm currently working on fixing some longstanding bugs in RoadArchitect. It's free and open-source, and thus can be used in commercial games. At the moment, however, the actual road and object placing code is editor-only and you would have quite a bit of work to do to get it to function in runtime mode.

    If you're interested, I can give more details.

    https://github.com/embeddedt/RoadArchitect
     
  3. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Just fell on this. Excellent ! Does it work on mesh or only terrain ?
     
    embeddedt likes this.
  4. embeddedt

    embeddedt

    Joined:
    Mar 10, 2018
    Posts:
    36
    This question is kind of hard to answer without going into implementation details, but I'll try.

    RA's editor interface only works on terrain at the moment (I will look at whether it is possible to fix that). It can be a completely flat terrain, however, so (untested) you might be able to put your mesh right on top of it (i.e. Y position of 0.01). I'll experiment with that and then reply again.

    However, the actual road generation code has no complex dependencies on terrain whatsoever, so I think it could fairly easily be modified to work on a mesh as well.

    P.S. If you have a GitHub account, it would be easier to have this discussion in a GitHub issue. For some reason I can't get the forum to email me automatically so I have to manually check it, whereas GitHub emails me automatically when someone comments on an issue.
     
  5. embeddedt

    embeddedt

    Joined:
    Mar 10, 2018
    Posts:
    36
    It's even easier than that. You can create a perfectly flat terrain underneath your mesh with a Y position of 0 then uncheck the Terrain component (and the collider as well if you want). I tested and RoadArchitect seems to still work that way.
     
  6. embeddedt

    embeddedt

    Joined:
    Mar 10, 2018
    Posts:
    36
    And I just made it even easier. You can now create roads on flat areas of meshes as well (i.e. planes).