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

Eyes moving in opposite motion in mecanim[Solved]

Discussion in 'Animation' started by Benzychan1, Mar 19, 2015.

  1. Benzychan1

    Benzychan1

    Joined:
    Mar 19, 2015
    Posts:
    11
    Hello, I'm really new to all this, basically trying to learn my way through making and rigging a 3d character. I've rigged it in blender and everything works and moves correctly in there. But when I import it and use the Humanoid rig generator in Unity everything works smashingly except for the eyes and piercings which fly off in the opposite direction of where the rig is moving in the muscles tab. Now in blender I have the eyes and piercings parented to the head bone and am wondering if the conversion is getting thrown off. If anyone can help or has a work around for this I'd be grateful! Thank you!

     
  2. Benzychan1

    Benzychan1

    Joined:
    Mar 19, 2015
    Posts:
    11
    Bumping.
     
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Disclaimer - I dont use blender.
    I think you may need to add a bone for each eye and each piercing in blender.
    Skin weight the mesh objects to each new bone - then reimport.

    In Max instead of using bones Id use a dummy (null object) instead of bones so I could orient the dummies to the mesh objects so there pivots are the same as the mesh objects. Then skin weight 100% to the null object dummies.
     
  4. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    Which bone you have skinned them? Make sure that they are skinned 100% to that bone. Try also to export using 6.1 FBX exporter and see if that makes a difference.
     
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    He stated in the original post they are not skinned - they are only parented to the head bone.
     
  6. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    Oh, thats right! In that case he needs to parent them again in Unity or skin them to a bone in Blender. I use Blender and Unity a lot but never tested if the parent relationships export correctly, doubt they won't if the parent is a bone.
    Eyes and piercings should be a same object as the body, there is no reason to keep them separate especially if they use same material and rig. Bad practise, wasted computational resourses GRR! :D
     
  7. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    I agree there should be bones or nulls controlling the eye & piercing objects if they are not part of the head mesh.
    In a cinematic scene the eyes and piercings would work better and be easier to control being separate objects with unique controls/bones.
    But if it's a full body character as in a 3rd person or fighting game, unless there are are a lot of close up shots of only the head and face, optimizing the character would be best.
    Another option is to attach the piercings and move them by morph targets / blend shapes
     
  8. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    I would advise against morph targets / blend shapes in 99% of cases involving rigid objects like piercings, but its an option.
     
  9. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Agreed, just stating other optional (working) processes other than direct parenting in blender.

    Interestingly I don't believe I've ever tested out parent/child linking in 3D Max imported into Unity either. Note to self - test to see how Unity handles it. I'd assume .fbx dumps that software proprietary data so Unity doesn't even see it, but bone hierarchies are read/written correctly. I'm guessing it treats non "character" type bone hierarchies differently and with a skinned character as in this instance the transformation/rotation based on root node or code can cause some unexpected results.
     
  10. Benzychan1

    Benzychan1

    Joined:
    Mar 19, 2015
    Posts:
    11
    Now see, I tried that too, after just parenting them all to the head bone failed. I also tried skinning them and nothing seemed to work. I guess I could just join them. But I was planning on using this mesh for practicing facial animation as well so that's why I was keeping the eyes separate.
     
  11. Benzychan1

    Benzychan1

    Joined:
    Mar 19, 2015
    Posts:
    11
    Yeah I know. But I was hoping to eventually animate the face as well. which would be much easier with separate objects. Oh well..I'll try merging it into one object and skinning again.
     
  12. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Unique bones and skinning for the separate eyes and piercings should have worked. Possibly you skinned them to the 'new' bones but the separate meshes were still parented to the head bone?
    This would cause some issues.

    By the way - cool character!
     
  13. Benzychan1

    Benzychan1

    Joined:
    Mar 19, 2015
    Posts:
    11
    That could actually be it...I can't recall if I ever separated the parenting. Boy, that's a stupid mistake..XD. But yes...I will go back and fix that and see if that helps matters. And thank you!! It's my first model. Hence...rookie errors and whatnot.
     
  14. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Not stupid, nor rookie. We all make little mistakes at one time or another. :)
    Animation - and even more so with game development animation - tends to amplify all the little errors we make. There are 100 steps to remember to do while creating a character from start to finish.

    Update when you find the solution.
     
  15. Benzychan1

    Benzychan1

    Joined:
    Mar 19, 2015
    Posts:
    11
    Well, I fixed it. I did an earlier suggestion, which is joined everything and weight panted it, which worked this time around since I unparented the eyes and the piercings.
     
    Flurgle and theANMATOR2b like this.