using System; using UnityEngine; using Random = UnityEngine.Random; namespace Comp { public class AudienceActionComp : MonoBehaviour { private Animator _animator; private const float MinY = -0.9f; private void Start() { _animator = GetComponent(); InvokeRepeating("Cheer", Random.Range(3f, 5f), Random.Range(3f, 5f)); } private void Cheer() { _animator.ResetTrigger("cheer"); _animator.SetTrigger("cheer"); } private void FixedUpdate() { var position = transform.position; position = new Vector3(position.x, MinY, position.z); transform.position = position; } } }