Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Level Design Workflow

Discussion in 'General Discussion' started by ECampese, Apr 29, 2021.

  1. ECampese

    ECampese

    Joined:
    Jun 20, 2020
    Posts:
    8
    Hello guys.

    I'm starting out with Unity, and I have a question about the level design workflow.
    I tried to place assets that I've created in Blender, in Unity. I find the positioning of things quite hard in Unity, I would prefer to use Blender, and export the whole level in Unity once completed.

    I hope I'm not the only one who prefers this workflow. Now my question is, how do you handle situations like Colliders?

    This is my current scenario. I got this level in Blender, a plane and some obstacles on top. The importing in Unity went smooth and everything is fine. Now I need to add colliders to the obstacles, and also to things that should be "not traversable". But I have a lot of rocks, a lot of different objects scattered around which would need a collider, and all the time I gained by using Blender for the level design I'm wasting it again by adding all the colliders manually, one by one.

    So, how do you do? How do you handle this issue?

    Thank you for your time!
     
  2. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Pretty sure there's an import setting that allows you to import colliders for each individual mesh. Check the object in Unity - the FBX file.
     
  3. ECampese

    ECampese

    Joined:
    Jun 20, 2020
    Posts:
    8
    First, thank you for your reply!

    I've just checked, and yes there is. It will add a "mesh collider" for each item. From what I know though, having "mesh" colliders is overkill for the performance right? Like for rocks, or small things. Correct me if I'm wrong.
     
  4. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    That's right - if you're getting less than 60 FPS when you play your game, you should consider avoiding the mesh colliders. Otherwise, don't get bogged down in premature optimization.

    However, if you really feel you need to avoid it, you could probably create an editor script that pulls the location of your gameobjects in a certain parent GameObject in your scene, and then from the MeshRenderers (which give the center and bounds of an object) create box colliders for each.
     
    Billy4184 and MadeFromPolygons like this.
  5. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    If you target desktop its ok to use static meshes in my experience. Try to use konvex option were possible. Also when possible use primitive colliders
     
    MadeFromPolygons likes this.
  6. ECampese

    ECampese

    Joined:
    Jun 20, 2020
    Posts:
    8
    Ok so for the static objects a mesh collider is not a problem. It will not impact hugely on the performance, right? Also, I should use convex where possible.
     
  7. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,516
    I'm not super familiar with 3D modelling, but my understanding is that if you export an entire scene from Blender or whatever then everything comes across as an individual GameObject, even if they're duplicates of the same 3D models. Is that correct?

    If so then to me that's a slam dunk reason to make models in Blender and assemble levels from them in Unity. A few reasons:
    1. Reducing duplicated content in memory, which is wasted if you have a bunch of copies of the same thing in there.
    2. Also reducing computational effort to draw stuff. Drawing 10 identical objects is slower than drawing one object 10 times.
    3. You asked about "workflow". As a personal preference I totally understand wanting to work in tools you are already familiar with. However, in regards to the wider workflow, potential team environments, and so on, using your engine's Scene editor reduces a lot of friction from your overall workflow.

    Honestly, #3 alone seals the deal for me. You've already run into it with your colliders. For that specific issue you can auto generate colliders on import, so that one isn't a big deal. But colliders are just the first of many cases you're going to run into. When you need to start adding logic to your scenes you're going to need to do things like add different components for your functionality, put objects on correct layers, and all sorts of other things. If you stick to a workflow where changing your scene's layout requires re-exporting from a 3D modelling package then there's a good chance that some of this other work will get lost. For example, there are various ways that a re-exported object can lose attached scripts, and all of the settings previously applied to them.

    Unity's workflows aren't perfect, but they are designed as decent starting points for typical game development workflows. There's a good reason that game engines come with scene editors instead of just telling us to use our 3D modelling packages. They may look similar, but the work we do in each has fundamentally different goals, intents and requirements. Which is a long way of saying that I strongly recommend that you learn to assemble your levels inside your engine rather than inside your 3D modelling package. It'll suck while you learn the ropes, and then save you oodles of time afterwards.

    Individual objects in your modelling package, scenes in your engine. :)
     
    Last edited: Apr 30, 2021
  8. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,793
    1.Buy a gaming mouse so you don't get bored while moving objects on the scene
    2. Use the Cubes to create colliders for the rocks. Finally disable Mesh
    Renderers
    . In this case, you can easily see the scale and position of colliders
     
  9. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,541
    Mesh collider is NOT your friend.

    import the mesh, then use primitives to make appropriate colliders.

    It’s paramount to minimize the amount of colliders to keep your game running smooth.

    when you use mesh collider you are essentially turning every poly into its own collider.

    In a pinch it’s okay with lower poly count models is they are completely static.

    But if you are moving them you’re effectively turning your cpu into a heat lamp.