I am new to Unity3D and I am going to develop a simple animation application. There is a human character and there are three button Eg:- "jump", "down" , "roll", I want to bind the animation files with the human character once the player presses the corresponding button. I need your help to know that what are the steps that I need to follow...let me know if anyone has good reference, thank you very much...

  • \$\begingroup\$ The best place to go isn't StackExchange, but UnityAnswers. That is a much better website. Specifically, here is the answer to your question. answers.unity3d.com/questions/17090/… \$\endgroup\$
    – user31435
    Jun 3, 2013 at 6:36

1 Answer 1


First off: There is the unity scripting reference, it is the best tool when creating anything with Unity3d.


http://docs.unity3d.com/Documentation/ScriptReference/Input.GetKeyUp.html For input keys read about the Input.GetKeyUp - Returns true during the frame the user releases the key identified by the key KeyCode enum parameter. If you want to have the player walk straight you will want to use the function Input.GetKeyDown

For creating basic character movement, go through official unity3d guides and play around the unity basic assets, which contain the two different character controllers.

/// This script moves the character controller forward 
/// and sideways based on the arrow keys.
/// It also jumps when pressing space.
/// Make sure to attach a character controller to the same game object.
/// It is recommended that you make only one call to Move or SimpleMove per frame.    
var speed : float = 6.0;
var jumpSpeed : float = 8.0;
var gravity : float = 20.0;
private var moveDirection : Vector3 = Vector3.zero;
function Update() {
    var controller : CharacterController = GetComponent(CharacterController);
    if (controller.isGrounded) {
        // We are grounded, so recalculate
        // move direction directly from axes
        moveDirection = Vector3(Input.GetAxis("Horizontal"), 0,
        moveDirection = transform.TransformDirection(moveDirection);
        moveDirection *= speed;

        if (Input.GetButton ("Jump")) {
            moveDirection.y = jumpSpeed;
    // Apply gravity
    moveDirection.y -= gravity * Time.deltaTime;

    // Move the controller
    controller.Move(moveDirection * Time.deltaTime);


For tutorials I have once found an entire tutorial, how to script a unity3d rpg game in C# from scratch.


http://Digitaltutors.com have some awesome tutorials on unity covering all basics. (They are paid)

http://www.youtube.com/user/BurgZergArcade?feature=watch You could start by watching some of the vids on this channel, they are free and there are over 50 hours of C# scripting lessons, they youtuber explains carefully everything.

Good luck


I have missed the part where you wanted to make an "Animation", so if you want to move your character around you should use the physic vector3 functions that I mentioned before. In case you meant playing back a pre-made animation from some external 3d graphic program you should take the animation from the project view drag and drop it on the item that is supposed to be animated. The function is called Animation.Play


 // Plays the walk animation - stops all other animations in the same layer
    // Plays the walk animation - stops all other animations
    animation.Play("walk", PlayMode.StopAll);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .