i have 2 BlendTrees set up. walkBT and runBT.
parameter bool holdShift is the only condition for the transitions between them
i HAD it working where i held shift and it would make holdShift True. and switch BlendTrees.
but i forgot to add a second check to make it false when not holding shift.
so I added that second check, and suddenly it won’t work at all. I half panic and control Z my code back to before adding it. And it suddenly wont work at all.
thats just to show what I said above
using System.Collections;
using UnityEngine;
public class AnimatorHotKey : MonoBehaviour
{
Animator anim;
public KeyCode myKey;
public KeyCode altKey;
public string AnimatorBoolName;
void Update()
{
if (Input.GetKey(myKey) || Input.GetKey(altKey))
{
anim.SetBool(AnimatorBoolName, true);
}
if (!Input.GetKey(myKey) && !Input.GetKey(altKey))
{
anim.SetBool(AnimatorBoolName, false);
}
}
}
thats my parameter updater. Added the component to my gameobject. Put in Left Shift, Right Shift, and holdShift.
run game, my first BlendTree is working, I hold shift, I can see that holdShift isnt changing and nothing is happening. Cry. try not to cry. cry harder.
what did I mess up when I went to fix this.