Basic animation scripting does not work like tutorial

Hi,

http://unity3d.com/learn/tutorials/modules/beginner/animation/animator-scripting

I copy the script in this tutorial. but does not work, what did i do is …

  1. new project, new scene
  2. I drag my character I bought onto a scene
  3. I add scripting file (test.cs) to the character
  4. I create an Animation Controller named as New Animator Controller
  5. I added an Animation Controller to the character.

I have try like this carefully many times (maybe 20+ times) but it does not work, I think I missed something that I don’t know
Please advise :slight_smile:


Looks like you dont have any parameters set up for your Animator Controller. Hard to say without more info.

Thanks for reply, I added parameters
Speed as float, Jump as boolean. still stuck.
what should I try ?

please advise

I have a basic tutorial on setting up an AnimatorController, and another on Scripting for player input. Perhaps they’ll help sort out your problem. They’re a bit simpler than your game though, just an idle animation and a walk/turn animations. I’ve imported my character as a Generic rig.

Wow your videos are great! with a detailed explain. Do you have any recommended videos about animation scripting ?
If possible I would like to see the one after above one you mentioned. The one you show me its about animation controller,
I also would like to see scripting part. Please advise

What exactly isn’t working?
I’m not sure if this is what you are asking but, if you are trying to make it animate through a script, you need to have a animation component for it to know what animations to load up.

Sorry for confused question as I’m newbie
My problem is trying to make a character model move by Animation Controller + Scripting
I can make a character move by Animation Controller but I can’t make it move by scripting
such as I want character jump when I pressed a space key. any advise please help :slight_smile:

These are wonderful. Only sampled a few but definitely am looking forward to watching and working through some of these this weekend. Thank you for creating these.

Assuming the animation is called 'anim_Jump"

This will play the animation “anim_Jump” when space is pressed.

if (Input.GetButtonDown ("Jump")) 
{
        animation.Play("anim_Jump");
}

Thanks for helps I’ll try again :slight_smile:

The scripting one is here. No jump, just idle, walk ahead or turn right or left. The complete playlist is here.