How do I know what this relates to?

Before I say anything, been using Unity for about a week, so I am still very new with it.

The script “Locomotion” as I am calling it, seems to be spitting back this message, but otherwise seems to have no errors. I am trying to write an animation script for a 1st person Ethan ~ Stealth module.

Console reads 1 Error

Script error: OnAnimatorMove
The message must have 0 or 1 parameters.
The message will be ignored.

The OnAnimatorMove segment…

void OnAnimatorMove (float Horizontal, float Vertical, bool sneak)
{
	anim.SetBool(hash.sneakingBool, sneak);
	transform.rotation = anim.rootRotation;
	if(Horizontal != 0f || Vertical != 0f)
	{
		anim.SetFloat(hash.speedFloat, 5.5f, speedDampTime, Time.deltaTime);
	}
	else
		anim.SetFloat(hash.speedFloat, 0f);
}

And then the warning

Assets/Scripts/PlayerMovement/Locomotion.cs(12,31): warning CS0414: The private field `Locomotion.animSetup’ is assigned but its value is never used

Deleted the line, and then the script said animSetup was not present. So I can only presume the checker missed it. And cause it is a warning and not an error, I will ignore this part for now.

According to the API reference this message has 0 parameters and so should be declared as follows:

void OnAnimatorMove() {
    // your implementation here
}

Any other variables should be stored within your class.

I think that you shouldn’t be using the variables named Vertical and Horizontal.

Just test if with other names, let’s say p_vertical and p_horizontal, and let me know if it works.

If it does, I’ll try to explain why that happens.