I have created a 1D blend tree. It is being used for a 3rd Person Controller.
The blend tree consists of 3 animations:
- aim pistol down to the floor
- aim pistol at middle of the screen (straight forward)
- 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?
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.