FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionanimation setup script needed

more_horiz
i've already made a walking animation, a idle animation, a sprint (run) animation and a jump animation. now i just need a animation setup script who is easy to use XD.


Thanks for helping me  Wink

descriptionRe: animation setup script needed

more_horiz

Code:


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


Well here's the script for animsetup that I use for my fps tutorial series. This is pretty much the simplest it gets.. I changed animation.play to animation.crossfade, to transition animations more smoothly. Attach this script to you're object with the animations you want to play, and don't forget to replace the key input you want it to play on, and the animation name.

ALSO, to stop anims you can use this:

Code:


    function Update()
{
 if(Input.GetKeyUp("w"))
 {
  // Plays the _____ animation - stops all other animations
  animation.CrossFade("idle");
 }
}
Permissions in this forum:
You cannot reply to topics in this forum