Home Technical Talk

Animating multiple objects

Hello all,

I am trying to get these wind turbines animated for use in a game using Unity.

How would I go about animating these so the animation loops in unity?
Will the blades be separate objects or does the entire fbx file havto be one object?
how would I export the animation for unity and how do i tell it to begin looping once the object is visible?

acyf52.png

Replies

  • LMP
    Options
    Offline / Send Message
    LMP polycounter lvl 13
    I'm not too knowledgeable on Unity and that sort of thing, but I think it generally needs to work like this...

    For a basic animation where the windmills just sit there and the blades turn, your objects will need to be in at least 2 pieces: the tower and the fan. The primary object will be the tower. The fan will be parented to the tower, and you'll want to make sure the pivot is centered properly so that it rotates right.
  • Nesmos
    Options
    Offline / Send Message
    Nesmos polycounter lvl 6
    tonyd927 wrote: »
    Hello all,

    I am trying to get these wind turbines animated for use in a game using Unity.

    How would I go about animating these so the animation loops in unity?
    Will the blades be separate objects or does the entire fbx file havto be one object?
    how would I export the animation for unity and how do i tell it to begin looping once the object is visible?

    First of all you can make one turbine then copy and paste, you have to make two object the fan and the base. to be honest i don't think you have to go in and make an animation since you could write a simple script that can make the fan rotate so it saves you time. if its going to be more that spinning create the animation yourself.

    Check the unity script reference website for more on how to create the script

    http://docs.unity3d.com/Documentation/ScriptReference/Transform.Rotate.html
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    For a simple transformation-based animation (move, scale, rotate) you can do this in Maya and export it to Unity, or simply create the animation in Unity. For this I think it comes down to personal preference mostly.

    Either way, definitely have the blades set up how LMP and Nesmos described.
  • tonyd927
    Options
    Offline / Send Message
    Bartalon wrote: »
    For a simple transformation-based animation (move, scale, rotate) you can do this in Maya and export it to Unity, or simply create the animation in Unity. For this I think it comes down to personal preference mostly.

    Either way, definitely have the blades set up how LMP and Nesmos described.

    Ok thanks everyone! Ill look into it.

    Only issue Im having is if I duplicate the tower and/or combine the meshes, I lose the animation.
  • Nesmos
    Options
    Offline / Send Message
    Nesmos polycounter lvl 6
    tonyd927 wrote: »
    Ok thanks everyone! Ill look into it.

    Only issue Im having is if I duplicate the tower and/or combine the meshes, I lose the animation.

    Make the turbine a prefab and it should save everything about it, also it might just be that the animation isn't selected
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    tonyd927 wrote: »
    Ok thanks everyone! Ill look into it.

    Only issue Im having is if I duplicate the tower and/or combine the meshes, I lose the animation.

    You lose your animations in Maya when you duplicate/combine because you're generating a new object; and keyframes don't transfer to new objects.

    You only need one turbine animated in Maya, so export that to Unity (make sure Animations is checked in your FBX export settings), create a prefab, and duplicate that object inside the engine. You should also be able to offset the animations per object so the turbines don't all spin perfectly synchronized.
  • tonyd927
    Options
    Offline / Send Message
    So I exported it, and imported the fbx into maya and there is no animation. There is an option box that says animate but it's turned on. Im confused.
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    Choosing the following settings will export any animations related to your model:

    Export.png
    If you have complex animations with controllers, special inputs etc. you can choose to Bake Animation

    From here you can load the FBX file into your Unity Project then set up the animations from within the engine.
  • tonyd927
    Options
    Offline / Send Message
    I did that..It just wont show up in Unity.

    It shows up in the little model preview at the bottom right of the screen in unity but it doesnt play once the asset is added to the scene
  • Nesmos
    Options
    Offline / Send Message
    Nesmos polycounter lvl 6
    Could you take a screenshot of what you mean ? it would help.
  • tonyd927
    Options
    Offline / Send Message
    It plays in the blue box on the bottom right, but doesnt play the animation when im running the game.

    14tqw4i.png
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    You need to configure your rig and animation so it plays properly.

    With no joint system you will need to use the Legacy rig; under Animations be sure to set it to Loop so the turbine will continue to spin.

    Anim.png
  • tonyd927
    Options
    Offline / Send Message
    Ok so thats done.
    Thank you.

    I got the animations working now how can I export this so my project lead can import the complete model into unity?
    (there's four towers, using the same animation, how do I export the prefab?)
    Prefab didnt work
  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    Once your object is set up the way you want, drag it from your scene into an empty prefab. If you make changes, you need to drag the object back into your prefab to push the changes through.

    You should be able to right click on your prefab and choose Export Package. A window will show up confirming all the related project files (should be source model, textures, and materials). Clicking Export... will prompt an export window where the .unitypackage file will be saved. You can give this to your project lead and he can import it into his scene.
Sign In or Register to comment.