- Home /
How to use/access animation of imported model?
I downloaded a free package (with some turret models) from the asset store but don't know how to use that in code (making it play the animation). The models have separate parts. I think I can animate the parts I want by creating the animations myself but looks like those models already have some pre-built animation. I can play it via the Inspector of the import settings (select the Animation tab), something like in this image:
However when I select the gameObject (from the model being dragged into the scene) and open both the Animation and Animator window, I see nothing.
I only know how to play the animation in code if the object has some Animation or Animator components. This thing is very strange to me maybe because I'm still fairly new to Unity. Could you point me in the right direction on how to use that model with its designed animation in my code (means controlling it in code)?
Thanks for your time helping me!
Create an Animation Controller in your Project Hierarchy.
any mod please reviews and approves my own answer to my own question.
What exactly do you want the model to do and how will it be accomplished? Triggers? $$anonymous$$eypress?
@GraviterX I solved my own problem. I don't think it's too difficult to understand the problem here. What I want is access to the imported animation. After importing, you can play the animation via Inspector but don't see where the animation clip is. I found that it's very hidden under the model hierarchy (grouped into an icon having an expanding arrow).
Answer by VipHaLongPro · Apr 02, 2015 at 06:15 AM
I've found the imported Animation Clip (which was very hidden) myself. It is under the model hierarchy. Its properties are disabled and can be changed only via the Model Import Settings (in the Inspector window when you select the model). The reason it looked so hidden is because the model in the project view looks like a Sprites bundle having a right expanding arrow. Clicking on that arrow will expand all the closest parts (in the hierarchy) including the imported Animation Clip.
With the imported animation clip found, of course I know how to animate the gameObject (using some Animator) and control it in code.
Hope this may help someone else!
Your answer
Follow this Question
Related Questions
Can't find Mecanim? 2 Answers
World of Warcraft Model Import 1 Answer
Problems Importing Rigged Model from Blender to Unity 2 Answers
Can rig importing be disabled on Models? 1 Answer
How to get and use animation clips of a model via script? 1 Answer