Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 60
Points : 1621
Rep : 3
Join date : 2014-04-29
Location : Algeria
View user profile

need help with animation

on Sun May 11, 2014 3:32 pm
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 pm; edited 1 time in total
avatar
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 64
Points : 1781
Rep : 15
Join date : 2013-12-19
View user profile

Re: need help with animation

on Mon May 12, 2014 6:48 am
Message reputation : 100% (1 vote)
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
avatar
Admin
Admin
Posts : 608
Points : 3167
Rep : 406
Join date : 2013-12-12
Age : 21
View user profilehttps://www.youtube.com/user/misterninjaboy

Re: need help with animation

on Tue May 13, 2014 8:23 am
Message reputation : 100% (1 vote)
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)
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 60
Points : 1621
Rep : 3
Join date : 2014-04-29
Location : Algeria
View user profile

Re: need help with animation

on Tue May 13, 2014 4:34 pm
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?
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 60
Points : 1621
Rep : 3
Join date : 2014-04-29
Location : Algeria
View user profile

Re: need help with animation

on Tue May 13, 2014 4:39 pm
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 
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 60
Points : 1621
Rep : 3
Join date : 2014-04-29
Location : Algeria
View user profile

Re: need help with animation

on Tue May 13, 2014 4:40 pm
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 
avatar
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 64
Points : 1781
Rep : 15
Join date : 2013-12-19
View user profile

Re: need help with animation

on Wed May 14, 2014 6:56 am
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
avatar
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 64
Points : 1781
Rep : 15
Join date : 2013-12-19
View user profile

Re: need help with animation

on Wed May 14, 2014 8:58 am
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);
}
}
}
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 60
Points : 1621
Rep : 3
Join date : 2014-04-29
Location : Algeria
View user profile

Re: need help with animation

on Wed May 14, 2014 3:39 pm
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 
avatar
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 64
Points : 1781
Rep : 15
Join date : 2013-12-19
View user profile

Re: need help with animation

on Wed May 14, 2014 7:59 pm
did it work
Back to top
Permissions in this forum:
You cannot reply to topics in this forum