Search Unity

Blender Import - Sub object at wrong location in Unity

Discussion in 'Asset Importing & Exporting' started by MacStanley, Nov 12, 2017.

  1. MacStanley

    MacStanley

    Joined:
    Jul 18, 2013
    Posts:
    118
    Hey there,

    I've created a simple barn in blender and when trying to import the blend file directly to Unity I've noticed that the door is at the wrong location. Instead of the front right its at the back left.

    Here is what it looks like in Blender:

    upload_2017-11-12_16-41-43.png
    upload_2017-11-12_16-42-46.png

    And here what it looks like in Unity:

    upload_2017-11-12_16-42-11.png upload_2017-11-12_16-42-26.png

    Anyone has an idea about this behaviour?
     
  2. MacStanley

    MacStanley

    Joined:
    Jul 18, 2013
    Posts:
    118
    I was able to solve this issue by resetting the rotation and scaling in blender.

    Unfortunately I have another problem with blender files. When I create a simple object like an pickaxe for example I will end up getting weird scaling and rotation effects with the object when I child it to an empty parent object. Here is what I do exactly:

    1) create a cube

    upload_2017-11-13_18-35-38.png

    2) Adjust the size so I end up with something like this:

    upload_2017-11-13_18-40-8.png

    3) Adding two cut loops at the top

    upload_2017-11-13_18-42-32.png

    4) extruding both sides 3 times

    upload_2017-11-13_18-44-21.png

    5) Moving the verticies so it looks a little bit like a pickaxe

    upload_2017-11-13_18-47-53.png

    -> Continue with the next post to this thread
     
  3. MacStanley

    MacStanley

    Joined:
    Jul 18, 2013
    Posts:
    118
    6) Reseted rotation and scale in blender

    upload_2017-11-13_18-53-45.png

    7) Import settings in unity:

    upload_2017-11-13_18-50-51.png

    7) Object in Unity scene:

    upload_2017-11-13_18-55-34.png

    The first thing to notice is that X rotation in unity seems to work, but y as well as z both seem to rotate the object around the y axis (world). As soon as I child this gameobject under an empty object the rotation seems to be fine, but the weird rotation problems apply to the empty object then (which I'd like to rotate later on).

    Any one has an idea about this?
     

    Attached Files:

  4. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Suggestion: Don't scale your objects in Blender; leave them at scale of 1. Instead, go into Edit mode and scale the mesh geometry. Same for rotation and translation.

    Also, I've found it works best if I use the "apply transforms" to my objects before exporting from Blender to Unity (control-A shortcut key).

    Generally, I've had the best results by building pieces in Blender and then prefabing them in Unity, rather than trying to build the entire hierarchy in Blender and exporting all at once. The FBX export can be told to only export the selected geometry. For Unity convenience, I make sure the origin point of each Blender object is 0, 0, 0 and their scales are all the same at the object level (but mesh geometry is whatever size it needs to be).

    Prefabbing in the Unity part of the workflow, instead of upstream, also allows you to use your individual objects more flexibly without going back to Blender.

    Hope this helps.