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.


Walking Animation Script(Help)

power_settings_newLogin to reply
+12
gggsss
DeveloperLuke
tanay2003
asihall
Noahfoah
FainterStreaker
DARTHVADEREX
daniel202gaming
yashtewarisaab
developer23
MisterNinjaBoy
Espon17
16 posters

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
daniel202gaming wrote:
MisterNinjaBoy wrote:
Make a new script, and use this to stop animations. Attach this script to you're gun.

Code:


     function Update()
{
 if(Input.GetKeyUp("w"))
 {
  // Plays the _____ animation - stops all other animations
  animation.CrossFade("idle");
 }
}



Whenever I try press w the console says
The animation state M9IdleAnimation(My Walking Animation) could not be played because it could not be found. ):
My idle animation is called IdleM9 just to be clear about that.
It is extremely annoying because I cannot get 1 stupid animation to play.
PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11

Try this:

Code:

var AnimationClip : AnimationClip ;
function Update() {

if (Input.GetKeyDown (KeyCode.W))
{
    animation.Play();
 
}

}

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
Hmmm... I try to put the script in the gun, (the walking and the stop animation, and I get this:

Code:

The AnimationClip 'walking' used by the Animation component 'CSS Arms FBX' must be marked as Legacy.


Not sure what "Legacy" means...

Here is my scripts for both of the things:

Walking:

Code:

  function Update()
{
 if(Input.GetKeyDown("w"))
 {
  // Plays the walking animation - stops all other animations
  animation.Play("walking", PlayMode.StopAll);
 }
}


WalkingStop:

Code:

    function UPDATE()
{
 if(Input.GetKeyUp("w"))
 {
  // Plays the _____ animation - stops all other animations
  animation.CrossFade("idle");
 }
}


Obviously, I have no idea what any of that means. Can you help me please?

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
Sorry but works for me, i haven't idea because doesn't works for you

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
I dont know why its not working for me either... I have the code and everything. Im wondering if the animation setup came with a plugin that was needed to make it work? If thats so, I need the download url please

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
Here is the video to my problem:
https://www.youtube.com/watch?v=HaGxoRZi8E4&list=UU03K626PqGtDR9ucffWfpLA

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
Well, now I took the scripts out, then I put it back in, and now it wont work at all.

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
What version of Unity is it?

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
Unity 4: version 4.5.1f3. Is that the same version you use?

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
FainterStreaker wrote:
Unity 4: version 4.5.1f3. Is that the same version you use?

Yes,you just go on window,animator,and under the text Any State add you animation (drag the animation in the Animator)

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

more_horiz
I have the animation set to it, and now it only does it once, if I dont push w or if I do.

descriptionWalking Animation Script(Help) - Page 2 EmptyRe: Walking Animation Script(Help)

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