- Home /
Animator is looping
Im trying to make a simple crouch script using animator. But it seems like my character ended up in an never ending teabag loop. I have tried to rearrange the animation boxes and ticked and unticked the looping function in them. But whenever i press the crouch key and release it it works. For some seconds, the the teabagging begins.
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class crouchingScript : MonoBehaviour {
private Animator animator;
// Use this for initialization
void Start () {
animator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Crouch"))
{
animator.CrossFadeInFixedTime("theBeastCrouch", 0.01f);
}
if (Input.GetButtonUp("Crouch"))
{
animator.CrossFadeInFixedTime("theBeastStandUp", 0.01f);
}
}
}
Answer by Cornelius12 · Jun 12, 2019 at 07:22 PM
ok so i found the solution. Ok, nice. Imma go sleep now
Your answer
![](https://koobas.hobune.stream/wayback/20220612203105im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D Animation does not start 1 Answer
Having some animation trouble 2 Answers
How can I make my guy stop running? 1 Answer
Issue with mecanim playing an animation using setbool 1 Answer
Imported Blender Animations not Working 2 Answers