# How do I set decimal values in 1D blend tree?

I have created a 1D blend tree. It is being used for a 3rd Person Controller.

The blend tree consists of 3 animations:

1. aim pistol down to the floor
2. aim pistol at middle of the screen (straight forward)
3. aim pistol up in the sky

To determine the blend value (which animation should be played), I inspect the current mouse position and convert it a value between 0 (aim low) and 1 (aim high). The middle position would be 0.5. Here is my code:

float f = Input.mousePosition.y / Screen.height;

Debug.Log("Blendval " + f.ToString());//
_animator.SetFloat("BlendVal", f);


I tried to insert these decimal values in the blend tree like this:

However, this doesn't work. Unity converts my "0.5" to 0. I don't see why.

I can instead use integers like this:

Why doesn't Unity allow me to use 0, 0.5 and 1? Why do I have to use "other" values like -1, 0 and 1?

Thank you!

Edit:

I don't understand what is going on. I have just typed 0.5 here instead of 0:

And then suddenly I could enter the values as desired, and even "Automate Threshold" would do what I expected:

But now it won't accept negative values anymore.

Strange.

• Looks like Unity thinks the parameter is of type "Trigger". Is your BlendVal parameter type set to "Float" (Animator Window, Parameters tab)? – Filip Milovanović Nov 14 '20 at 11:28
• @FilipMilovanović Thank you but I think it's Float. I have added a screenshot showing this. I have manually entered the value "0.5", and it worked. – tmighty Nov 14 '20 at 11:34