0
$\begingroup$

I am creating a very simple animation in blender of opening the box flaps and following the link here.

https://www.youtube.com/watch?v=qh2fhnQlJqU

I started to save the blender file under the asset folder in unity. So, I could see the effect of the changes in unity.

Everything was fine, and the box in blender and unity looked the same. However, as soon as I reach the step where we are animating the box and setting default position for frame 1 and close the top lid at minute 15:30 in the video and then I actually save the box to see how it looks and the box becomes sort of disformed.

If i open the flap again to default then it looks correct again, any sort of rotation of the flap disfigures it in unity. The rotation is around x axis. Any pointers or help of what i am doing incorrect in this case. I tried using a blender add on to fix rotation , however it became worse.

thanks.

Mohnish

$\endgroup$
  • $\begingroup$ Welcome to stack exchange! In order to help us help you, it is usually prudent to post pictures or video of what you have tried and what is happening. While the youtube link is helpful, it does not exactly describe your experience, especially because your problem takes place in Unity. $\endgroup$ – Kirbinator Jun 8 '17 at 23:48
0
$\begingroup$

2 things to try:

A) Unity and most game engines are sensitive to having a root position to base all other transformations off of. Unless you tell it otherwise, that root transform will be the bone at the top of the armature hierarchy. Make sure you have a root bone that all other bones are parented to, and make sure you do not apply animations to that bone. Without knowing more, I suspect you only have one bone, are animating it, and Unity is not handling that very well.

(EDIT) With the file provided, it turns out A is mostly true, but there is one more aspect you need to address. If you check the console of Unity, when it imports, it actually gives a descriptive error: FBX import error This means that all the verticies, which have not weight associated for them to a bone, will default to the first bone (the lid). So moving the lid will move the rest of the box too...because they were arbitrarily assigned to the lid. Just weight paint the rest of the box onto your root bone, and it works just fine.

B) It sometimes helps conceptually to have a one or two frame "idle" animation for things, especially if you are using the Mecanim editor in Unity. Then you have better control as to when the animation plays and how.

$\endgroup$
  • $\begingroup$ I actually have 3 flaps on a packaging box. I am trying to create an animation to open this box, It works in blender since the youtube video shows me that.So, I have 3 bones, one for each of the flap of the box. There is no bone that the 3 bones are parented to. This is my first time using unity and blender. $\endgroup$ – mohnish Jun 9 '17 at 0:29
  • $\begingroup$ It is then especially important that you choose a single, unanimated bone and parent those three bones to it. $\endgroup$ – Kirbinator Jun 9 '17 at 4:40
  • $\begingroup$ I tried to do what you said, but wasnt getting much ahead. So i decided to start fresh. Here's my blend file. dropbox.com/s/on69fo67bbcg4nx/box.blend?dl=0 If you put this in unity it will look proper. Then when you go to blender and select the big bone in pose mode and rotate it 90 ( r->x-> 90), such that the box is closed, the box will get deformed in unity. Any help on what i am doing wrong. I dont have any animations at this point, just armatures. $\endgroup$ – mohnish Jun 10 '17 at 1:26
  • $\begingroup$ see update to the answer $\endgroup$ – Kirbinator Jun 10 '17 at 6:59
  • $\begingroup$ thank you thank you. that console error really helped.. the window for console was off so i never saw it and then the root bone worked after i understood what you meant. $\endgroup$ – mohnish Jun 11 '17 at 4:10

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.