Trigger animation going crazy

When player stays on trigger, it only plays “moveOut” and it loops/repeats crazy, the loop is takin off the animation. So no idea whats going on.

	void OnTriggerStay(Collider other)
	{

		animation.Play("moveOut");
	}
	
	void OnTriggerExit(Collider other)
	{

		animation.Play("moveIn");
	}
}

That is normal. If you want to animate just once, try “OnTriggerEnter” instead of “OnTriggerStay”.

I guess what you are looking for is:

 void OnTriggerStay(Collider other)
 {
     if(!animation.IsPlaying("moveout")) 
         animation.Play("moveOut");
 }

So we only play the moveout animation if it is not already playing while inside the trigger so that the play is not triggered every FixedUpdate.

If you only want to play it once, then you shouldn’t call it in OnTriggerStay which occurs every frame the object is within the trigger.

Use OnTriggerEnter instead which occurs only once.