Search Unity

Question Level built in MagicaVoxel not really working in Unity

Discussion in 'World Building' started by jampamatos, Jun 11, 2020.

  1. jampamatos

    jampamatos

    Joined:
    Jan 26, 2019
    Posts:
    11
    Hey guys!

    So, I've been playing around Unity for one month and I decided it was time for me to create my own first game from scratch. It's going to be a very simple isomeric view 3D platformer, and I've been using Magica Voxel to do all the assets for it.

    So, I created the area for my first level on Magica Voxel, something like this:

    upload_2020-6-10_21-23-54.png

    I want the players to stay within the canyon, and the cliffs to work as bondaries.

    I exported it to .obj, opened it in blender to set the pivot point to the center, and exported as fbx to Unity. There, I marked the "Generate Colliders" under Meshes, and added a Kinematic rigidbody to it.

    upload_2020-6-10_21-27-44.png

    It looks good, but the colliders are not really working well. Most of the area the player is walking right through, like so:

    https://imgur.com/DW4Nzp8

    Did I miss any steps? What should I do to make it work? Or should I make it differently?

    Thanks, guys!
     
  2. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    It could be a precision problem. Check the scale of those objects. Also check the position (best keep them centered around origin (0,0,0)). If the character also uses a mesh collider make it convex, or better swap it for a capsule.
     
  3. jampamatos

    jampamatos

    Joined:
    Jan 26, 2019
    Posts:
    11
    I use a box collider to the character. And it might as well be a scale problem then, because the Magica Voxel asset is really small, and I've scaled it up by a lot, and I mean a lot. I'll see if I can scale down and zoom in with the camera.

    Is there a way to fix the colliders even if I scale the object up?
     
  4. jampamatos

    jampamatos

    Joined:
    Jan 26, 2019
    Posts:
    11
    Huh, looks like changing the player's collider from box to capsule did the trick. Why is that? I though using box would be better because, you now, my character is basically a box.
     
    Flavelius likes this.