I was working on a project and my animations are not playing.
anim.SetFloat(vertical, v, 0.1f, Time.deltaTime);
I get the hash error when trying to play the game
I was working on a project and my animations are not playing.
anim.SetFloat(vertical, v, 0.1f, Time.deltaTime);
I get the hash error when trying to play the game
SetFloat
method comes in 4 variants (overloads):
public void SetFloat(int id, float value, float dampTime, float deltaTime);
public void SetFloat(int id, float value);
public void SetFloat(string name, float value);
public void SetFloat(string name, float value, float dampTime, float deltaTime);
and your code, i.e.:
anim.SetFloat( vertical , v , 0.1f , Time.deltaTime );
assuming that both vertical
and v
are numbers, it matches this signature:
public void SetFloat(int id, float value, float dampTime, float deltaTime);
(4 numerical parameters)
In short, here is your call:
anim.SetFloat(
vertical , // id
v , // value
0.1f , // dampTime
Time.deltaTime // delta time
);
hash
is a numerical id
. So this error means that animator has no parameter with an id equal to whatever values vertical
has.