- Home /
unityengine.animator does not contain a definition for parameters
Hi,
I'm getting the following error when using the code from this post:
unityengine.animator does not contain a definition for parameters
I'm trying to find out if an animation controller has a particular parameter, as I need to catch an error if it doesn't exist. I'm using Unity 4.6.3f1 and have included the following at the top of the script:
using UnityEditorInternal;
.parameters is showing up in monodevelop as red, while everything else is fine, so this is clearly the problem, but I'm not sure how to ensure that it works.
public static bool HasParameter(string paramName, Animator animator)
{
foreach (AnimatorControllerParameter param in animator.parameters)
{
if (param.name == paramName)
return true;
}
return false;
}
Alternatively, if there are any other solutions for checking if an animation trigger exists, that would also be great.
Your answer

Follow this Question
Related Questions
OnTriggerStay with multiple collision parameters 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Issue regarding triggers? 1 Answer