3
\$\begingroup\$

I have the following animation controller:

enter image description here

with two parameters of walkingSpeed and Jump. I have the following code which should change the values:

animator.SetFloat("walkingSpeed",0.9f); 
animator.SetBool("Jump",true); 

and animator is the correctly referenced animator object. However the values that the parameters are set to do not appear to change in the animator window, nor do they appear to impact what is happening on the screen. However they do seem to impact the values obtained when doing the following:

animator.GetFloat("walkingSpeed");

The animator consists of the shown blend tree, which works correctly and is always active, however due to the values not being changed it does not blends, and always acts as if the value with which it blends (walkingSpeed is 0).

What is going on?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ I removed your 2nd question, because the general rule (see the help center) is one question per post. That second question might make a reasonable post of its own though, so feel free to make it is own question. \$\endgroup\$ – Seth Battin May 21 '14 at 14:02
  • \$\begingroup\$ Have a look at this tutorial on youtube youtube.com/watch?v=DJQn_EMEphE and then this one youtube.com/watch?v=e-D1sz39J9Y ... \$\endgroup\$ – Savlon Feb 20 '15 at 9:11
2
\$\begingroup\$

It sounds like you have two problems:

  1. In order to see the values changing, you must have the GameObject that is using that Animator selected in the Scene view.

  2. There is likely something wrong with your code or Animator that is preventing it from working as you expect it to. You have not provided enough details to determine what is causing that.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.