- Home /
Variable in animator not going directly to set value on Mouse Cklick
I want to do a transition from idle state or a blend tree to a slash animation, i have a SLASH variable float and in the code i set it to 1. The thing is i have to click the mouse button many times in order to reach 1 in the SLASH variable. It goes like 0.100 - 0.150, 0.180 and so on until it reaches 1. Why is that? I only run a if statement in the update checking if i clicked, and i change the float to 1.
if(Input.GetMouseButtonDown(0)) { Slash(); } }void Update() {
private void Slash() { anim.SetFloat("Slash", 1f, 0.1f, Time.deltaTime); }
And i have to keep cklicking for the variable to reach 1. Why?
Also for some reason when it works i have to wait for idle animation to finish before it starts playing slash animation, i have dissabled HAS EXIT TIME.
screenshot.png
(9.5 kB)
screenshot2.png
(6.0 kB)
Comment
Your answer
