UnityNinja Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

UnityNinja CommunityLog in

UnityNinja - Video Game Development Community, including Resources, Forums, Marketplace & More.


need help with animation

power_settings_newLogin to reply
3 posters

descriptionneed help with animation Emptyneed help with animation

more_horiz
i have a question about animation, i have a monster model in obj format imported to unity, and i have it's own animations in an fbx format. now how  can i add the animations to the monster?

Last edited by servival on Mon May 12, 2014 2:45 am; edited 1 time in total

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
step 1 put the monster in hierarchy

step 2 click on the monster hierarchy and look over to the inspector and click add component and and type animation.

step 3 in the animation type how many animation you have

step 4 select the animation you wont to put on the monster and drag and drop it in the animation you opened up

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
Also to add to ryan2brian's post, make sure the animation type is legacy, not generic. So when u click on the animation in the project assets, in the inspector make sure animation type is legacy (under rig)

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
MisterNinjaBoy wrote:
Also to add to ryan2brian's post, make sure the animation type is legacy, not generic. So when u click on the animation in the project assets, in the inspector make sure animation type is legacy (under rig)

Should i do that to the animation file or the monster file? or both?

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
MisterNinjaBoy wrote:
Also to add to ryan2brian's post, make sure the animation type is legacy, not generic. So when u click on the animation in the project assets, in the inspector make sure animation type is legacy (under rig)

I followed the steps but when i draged and droped the monster in the scene and started the game it didn't play the animation, is that what supposed to happen? or am i doing it wrong? Suspect 

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
ryan2brian wrote:
step 1 put the monster in hierarchy

step 2 click on the monster hierarchy and look over to the inspector and click add component and and type animation.

step 3 in the animation type how many animation you have

step 4 select the animation you wont to put on the monster and drag and drop it in the animation you opened up


I followed the steps but when i draged and droped the monster in the scene and started the game it didn't play the animation, is that what supposed to happen? or am i doing it wrong?  Suspect 

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
maybe you dont have anything to trigger your animation i think i have a script someway on my hard drive if i can find it i well share it with you

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
ok make a c# call it PlayAnimations and past this into it


using UnityEngine;
using System.Collections;

public class PlayAnimations : MonoBehaviour {
public AnimationClip clip;
public KeyCode code = KeyCode.Mouse0;

void Start()
{
if (!animation) this.enabled = false;
}

void Update()
{
if (animation)
{
if (Input.GetKeyDown(code)) animation.Play(clip.name);
}
}
}

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
ryan2brian wrote:
ok make a c# call it PlayAnimations and past this into it


using UnityEngine;
using System.Collections;

public class PlayAnimations : MonoBehaviour {
   public AnimationClip clip;
   public KeyCode code = KeyCode.Mouse0;

   void Start()
   {
       if (!animation) this.enabled = false;
   }

   void Update()
   {
       if (animation)
       {
           if (Input.GetKeyDown(code)) animation.Play(clip.name);
       }
   }
}

Thanks a lot man you realy helped me  Razz 

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
did it work

descriptionneed help with animation EmptyRe: need help with animation

more_horiz
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply