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

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » HELP » Help (General) » animation setup script needed

animation setup script needed

View previous topic View next topic Go down  Message [Page 1 of 1]

1 animation setup script needed on Tue Jun 03, 2014 9:02 am

Gekheid


Member [Lv. 1]
Member [Lv. 1]
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

View user profile

2 Re: animation setup script needed on Tue Jun 03, 2014 5:15 pm

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");
 }
}

View user profile http://www.youtube.com/user/misterninjaboy

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum