how do i get a blend tree blend value ?

hi,
I want to know hot to get a float value from a blend tree :
I want to restrict a script to make it launche animation only when my character is in Idle
to do that i use this code in the void update () :

       if (Cooldown && Neutral && IdleCheck())
        		{
        			Debug.Log ("oui");
        			timer = 0;
        			SonovoreNeutral ();
        		}

the probleme comes from the IdleCheck() boolean :
to try to make it work i used thoose lines of code:

private bool IdleCheck()//Check if the creature is in Idle
	{
		if (animatorComponent.GetCurrentAnimatorStateInfo(0).IsName("Locomotion") && LocomotionBlend == 0.00f)
		{
			return true;
		}
		else
		{
			timer = 0;
			return false;
		}
	}

Locomotion Blend reffers to a float that is detailed in the void Start() :

LocomotionBlend = animatorComponent.GetFloat("SonovoreLocomotionBlend");

Here the probleme is that unity does not find “SonovoreLocomotionBlend” which is my float’s Blend …

here is my blend tree

Thx for helping me (feel free to ask more informations) :smiley:

I still don't see the purpose of multiple terrains as tiles. Will you stick them together by random or are those only tiles for a turn based game where one tile equals one movement unit?

1 Answer

1

Animator.getfloat is looking for a parameter name not the named of the blend tree try having it search for the parameters name directly

how or where do i find that ? thx for your answer :D

Indeed they are randomly ordered next to each other. I twerked each tile to make the borders fix together. The game itself however is realtime.