I am very new to coding, please bare with me if I post something wrong.
The player is able manually pick up and hold an item. While the pick up animation is playing, the move controls are temporarily set to zero velocity, and then set back to the OnMove controls. If the player holds any of the move buttons before the WaitForSeconds has switched control back, the player will not move until they release the key(s) they are holding.
I would like to force the release of the movement buttons in the script so the player doesn't have to release the button to start moving. Totally a quality of life fix but a necessary one.
Thanks in advance!!!
(I can post more code if needed. Not 100% certain on how to post it, it doesn't seem to be as straight forward as posting an image or table, and it took me a while to find the "```" method. )
-Kyle
``` void OnMove(InputValue value) { if (canMove) { moveInput = value.Get<vector2>(); } else { rb.velocity = new Vector2(0, 0); } } void OnJump(InputValue value) { if (!feetCollider.IsTouchingLayers(LayerMask.GetMask("Ground"))) { return; } if(value.isPressed) { rb.velocity += new Vector2(0f, jumpSpeed); } anim.SetBool("isJumping", inAir); } void OnFire() { if (!playerHasHorizontalSpeed) { anim.SetTrigger("bend"); canMove = false; StartCoroutine(WaitForBendAnim()); } } IEnumerator WaitForBendAnim() { yield return new WaitForSeconds(0.6666666f); canMove = true; } }