Character Movement/Animation

Hello,

I have a question about Character Movement/Animation scripts within Unity.

I am trying to allow my character to move around freely using the arrow keys “a,s,w,d” while playing animations for walk cycles, run cycles, idle, strafe, jump, death, etc. I will also have a MouseLook script attached to the camera.

Although I have experimented with the scripts found in the ThirdPersonController and CharacterAnimation example projects–all I can get my character to do is stand there playing his idle animation–not even the FPSWalker script is creating movement for my character.

Does anyone know how to script something like this in a simpler form than the example projects have it? I am extremely new to scripting and I don’t really understand most of the longer scripts.

Any information is appreciated! Thank you!

–Velk

To start an animation that is set on your GameObject’s Animation Component use this code:

function Update () {
   animation.Play ("animationname");
}

similarly, if you want to crossfade so that it blends the old and new animations together for a moment to create smoother transitions, use:

function Update () {
   animation.Crossfade ("animationname");
}

Hope to see some cool stuff from you soon!

This page details how to do character animation starting with very simple examples:
http://unity3d.com/support/documentation/Manual/Character-Animation.html

if something is unclear on that page, just ask.