Controler conection

I already have the walk cycle 3D model, now how I make the conections, to the keyboard control it, whem I prees Up arrow?

the basics of keyboard is

// c# if( Input.GetKey( KeyCode.W ) ) { // move forward this.transform.position.Translate( planet.transform.Translate( 1 * Time.deltaTime, 0, 0 ); }

Haven't looked myself at setting the animation yet but take a look at ./Assets/Standard Assets/Character Controllers/3rd Person Controller

The GameObject has an animation component with a variable animation (duh), wich is set to run in the editor. Think you can control wich animation there.

Sort of like Alexandria described, but with the correct answer:

Standard input can be accessed through the Input class:

  • GetAxis and GetAxisRaw return a floating point value indicating the amount of input along an axis specified in the Input Manager. This would be used like `n = Input.GetAxis("Vertical");`
  • GetKey, GetButton, and Get MouseButton return true every frame that the specified input is held down and false otherwise. This would be used like `if(Input.GetKey("up")) DoSomething();`
  • GetKeyUp, GetButtonUp, and GetMouseButtonUp return true the frame that the specified input is released and false otherwise. This would be used like `if(Input.GetKeyUp("up")) DoSomething();`
  • GetKeyDown, GetButtonDown, and GetMouseButtonDown return true the frame that the specified input is pressed down and false otherwise. This would be used like `if(Input.GetKeyDown("up")) DoSomething();`

To play an animation, you would use the Animation Behaviour that would need to be a component attached to your GameObject and accessed through the inherited variable animation:

  • Play() plays the current or specified clip immediately. This would be used like: `animation.Play("Walk");`
  • CrossFade() fades the specified animation in and fades out the current animation on the same animation layer. This would be used like: `animation.CrossFade("Walk");`
  • PlayQueued() plays specified animation after the other animation(s) as determined by the QueueMode and PlayMode. This would be used like `PlayQueued("Walk");`
  • CrossFadeQueued() fades the specified animation in and fades out the current animation on the same animation layer after (or at the end of?) other animations as deternimed by the QueueMode and Playmode.. This would be used like: `animation.CrossFadeQueued("Walk");`

see here for more.

Combining the two is as simple as:

if(Input.GetKeyDown("up") animation.CrossFade("Walk");

If you want to move something through code, you would probably want something like:

transform.Translate(0.0f, 0.0f, Input.GetAxis("Vertical") * Time.deltaTime);