0
$\begingroup$

A similar question like this one exists already, but this one is much more specific.

I have uploaded a model here.

This model consists of 2 meshes. I have used an Empty to group them.

I want to bring this object over to Unity. This works fine, but in Unity, I have noticed that there's a slightly wrong rotation.

While I want the object to be perfectly rotated along the global axis (so that it appears not rotated in Unity), I can see that it is slightly rotated.

I have spent really much time trying to fix this manually.

I have found a way to automatically align a single object, but I have not found a way to automatically align a grouped object to the global axes.

Can somebody have a look at my grouped object (Blender 2.8 file) and tell me how I could solve this problem?

Thank you!

$\endgroup$
1
$\begingroup$

Firstly, I wouldn't worry that much about slight rotations. They are very hard to notice unless you stare at the model close up in orthographic view. It's also pretty normal for models imported into Unity3D to get given annoying rotations like 89.999999 on some axis. It's better to just ignore it than go insane trying to fix it.

However, to align all your objects to some axis you just have to align the top level parent how you want. Then you can apply the rotations down the stack or not as you wish.

First thing I noticed is your objects have picked up some delta transformations from somewhere. That can make the transformation values confusing, because the actual orientation will be transform + delta. So I'm going to clear the delta transformations from the empty. I'm also going to clear the delta rotations from the child objects because they are all the same. I will leave the delta location on the children because that is how they are matched up. I also zero out the regular transforms on the empty:

zero transforms

Now I find a face or faces in edit mode that I think should be aligned along a global axis but aren't. I take these ones in the centre of the 'bottom' object and snap the cursor to them as well as aligning my view to their Z axis (SHIFT+Numpad 7) since I think they should be aligned on Z:

select faces

Exiting edit mode, I add an object and align it to view. I choose an empty in this case:

align new object to vie

The 'WeaponCase' empty gets parented to this new empty I just made:

parent objects

Finally I clear the rotations from the new empty and then clear the parent of 'WeaponCase' making sure to 'keep Transformations':

clear rotationsclear parent

For here you can delete the empty and apply transforms if desired. Repeat the process if you need to make other alignments but keep in mind that depending on what faces you use to make new alignments, you may break this one.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.