Am learning Blender and currently getting into Animation, i have few questions to ask about exporting Blender files to Unity.

Hi everyone,

So i recently started doing more work with Blender, and i just finished this model today: 


i wanted to texture it but there is really something bothering me about rigging and animation, because at the end am learning 3D to use it in games, and animation is a must-have skill.

That's why i set a "mini" goal that in the next 3 month, i should be able to make a game similar to the "Last Invader", code wise the game is really easy to make, the real challenge for me is gonna be the creation of the assets, most importantly the animation and the workflow between Blender & Unity for that matter,

At the moment am worrying about what Rigging Technics should i use, i started watching the "Fundamentals of Rigging in Blender" Course and the first chapter is called "Mechanical Rigging" which make perfect sense for the robot game am making, however, in that method they don't use Bones at all, its all made with "Empties" and a bunch of Constraints, my main concern now is if that "Empty+Constraint" animation made in Blender will work in Unity or not, i even checked the Art Station of the Creator of the Last invader game, and he used the same Technic (no bones) but in Maya not Blender: 

Am wondering if that will works, i also want to know if an no-bones rig will allow some coding to effect the animation ? for example if i re-create that "legged tank" model, its "feet" should animate based on the blender animation, but the top part should follow wherever the player is aiming at, will that be possible ?

Overall, i am someone who've been professionally making 2D games with unity for 5 years, and i have NEVER made a 3D game, not even a prototype, so am kinda all over the place in that workflow, the only thing that am comfortable with is programming, and honestly am quite enjoying this, the challenge part of learning new things in game-dev is half the fun :)

Anyway,

i hope this wasn't too long, if you made ANY work with Blender and unity and feel that you have any advice please throw it in here, am focusing on rigging/animation but am still a total noob :p also if you guys can recommend any course/tutorial (here or elsewhere) that can improve my level in making 3D games with unity/Blender please leave a link

Thanks and have a good day!

  • Jonathan Gonzalez(jgonzalez) replied

    Creating something like that would probably require general IK to be used. Alan Zucconi has a good series on the topic using robot arms but it's definitely more complex than using the built in humanoid IK system. I'm not sure if it would look as good as what you have in the gif but that's what comes to mind. Other than that, if you didn't want to use IK maybe some fancy timing of the animations in conjunction with some scripted events would work. It's more limited, but it may look better as well. 

    As far as the 3d workflow it'll be fairly easy to get up to speed. Since you've been using Unity for a while now it's mostly just getting used to working with 3d objects and a 3d environment but a lot of stuff you've used in 2D also has an equivalent in 3D as well. 

    In the past constraints from Blender didn't transfer over well to Unity, but I did notice a checkbox for constraints under the animations section in the inspector recently.

     I don't know if that's always been there but I noticed it recently so maybe try importing your rig with the constraints as is and see if it works. IK probably wouldn't transfer over but at least you can see if your rig needs to be modified. 

  • Ala Dhiabi(alaslipknot) replied


    jgonzalez 


    Thanks for the quick reply Jonathan. 


    Just to clarify my question, i am not aiming to have IK inside unity (not willing to make a game like Limbo or Inside for example) i just want to make a top-down shooter with 3D asset to improve my 3D skills nothing else, so all IK, Constraints, etc... will be made in Blender, what am worrying about is will that export nicely to unity as an animation, i don't want for example to have that Gif act like that in unity  if i import that rigged model in unity and move its leg, i wouldn't expect the rest of the body to act "properly" (though that would be nice) but that's not the goal now, what i want is to have all these Constraints and/or Bones made in Blender so i can easily animate the model, and when i import it to unity i want the animation to persist with the ability of overriding some of its part, in my tank example its gonna be the turret.


    I posted the same question in the unity subreddit and someone there said i should use Bones even when am rigging a car, which honestly feels a bit confusing specially after watching the "Fundamentals of Rigging" here, it would be really great if you guys make a "Rigging for games" course, and in my opinion it should not have any "humanoid" rigging at all, because the internet is full of those, but most importantly because i wouldn't advice any beginner to start making a game with "humans", its fairly complex, and we detect bad animation there much more quicker than other things like robots for example (i'll put this idea in the new suggestion  post) 


    Anyway thanks again for the help man, i really appreciate it :)


    PS:
    the notification system is still not working properly, cause i didn't get anything after your reply.

  • Jonathan Gonzalez(jgonzalez) replied

    alaslipknot You can keep the bones in to play the animations. You can play animations and also control parts of the mesh by using avatar masks. The link I provided demonstrates how it works with a human character but with a generic rig like you  have, you'd have to specify the transforms that you want to block out from playing animations.

     So with a human you get a fancy human layout to create your mask, but with a generic rig it just gives you a list of transforms you can use.  I've never used them in a real time manner, but I have used them to block out parts of a rig that I want to exclude from animations. 

    Regarding the rigging, it's usually easier to animate an object when it has a rig but you can also keyframe everything by hand and moving everything around. Rigging just makes it easier since you can move a lot of things simultaneously. 

    A rigging for games course is something I've personally wanted to see as well. Rigging in Blender can be a bit complex and sometimes it doesn't always transfer over well to games. Rigging isn't something I'm great at, but I understand the process. 

    If you have any specific ideas of what you're trying to accomplish let me know. It's a bit tough to give you real advice without knowing exactly what you're trying to achieve. This is where I'd start first:

    • Import the model into Unity
    • Use Mecanim and an Animator Controller for a basic idle animation state
    • Add a second animation state you can transition to (like a fighting animation)
    • Add in a avatar mask to block out a part of the robot like the head or legs

    Once you know how to do that you can expand upon it. If you have any other questions let me know. 


  • techworker1 replied

    I used animated Empties once in Blender for a simple "mechanical" animation (bicycle), and it seemed to work well in Unity for me - more logical than bones. Just need to export "Empty+Armature+Mesh" to FBX, if I remember correctly.

  • Jonathan Gonzalez(jgonzalez) replied

    techworker1 Empties should work well, Unity would treat them as empty game objects. Basically anything that would have a direct equivalent in Unity would transfer over from Blender (usually). 

  • techworker1 replied

    jgonzalez  I very often use Empties in Blender when exporting to Unity, for various reasons. I use them to get nice hierarchies of obects which are convenient to handle. (Of course you can build this up in Unity too.) Often they are convenient holders for C# scripts. And animating them works well in both Blender and Unity.