- Home /
Need help with Animations
Hey guys, I just need some assistance setting up animations to trigger them on a player we want to temporarily implement into our RPG.
http://u3d.as/content/bisaniyehocam/animated-spartan-king/2cq
I have a free spartan character from the asset store that comes with 11 animations. However, these 11 animations come under 1 animation which I dont understand but them numbers must be significant.
I want something like this is my game:
function Start (){
if (Input.GetKeyDown(KeyCode.J))
Animation.Play("SpartanKingJump");
}
Answer by AMDAndrew · Nov 18, 2012 at 07:44 AM
Well dude you have a lot of problems there :
You are in update and your animation will be started once per frame ( 62 times per second let's say ).
The declaration is good but I'll give you a tip : Import your character controller script and do the following
var jumpAnim : AnimationClip;
function Update (){
var controller : CharacterController = GetComponent(CharacterController);
if (Input.GetKeyDown(KeyCode.J) && !controller.isGrounded)
animation.CrossFade(jumpAnim.name);
}
Your answer
Follow this Question
Related Questions
fbx animation to> blender 1 Answer
AnimationClip and AnimationState 0 Answers
Light animation and Main Menu animation at same time from 1 trigger 0 Answers
Looping animation while key down 1 Answer
How do I activate an animation when a gameobject enter the Collider of the other animated object 2 Answers