I’m thinking it should be simple…but I’m just an artist and I need this stuff just to help build my portfolio, so what I getting so far is having the character getting into the Attack Layer but never coming out. I need to press “q” for having the Attack Layer fully weighted. It does work fine with GetKey, but I want it to stay that way until I press “q” again to get him out. Could someone please give me a hint at least. Cheers!
// Start is called before the first frame update
void Start()
{
any_controller = GetComponent();
any_controller.SetLayerWeight(0, 1);
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(“q”))
{
any_controller.SetLayerWeight( any_controller.GetLayerIndex(“Attack Layer”), 1);
}
else if (!Input.GetKeyDown(“q”))
{
any_controller.SetLayerWeight( any_controller.GetLayerIndex(“Attack Layer”), 0);
}