Files
HauntedBloodlines/Assets/Scripts/Animations Scripts/PlayAnimationAtRandomFrame.cs
2025-05-29 22:31:40 +03:00

19 lines
377 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayAnimationAtRandomFrame : MonoBehaviour
{
Animator animator;
private void Awake()
{
animator = GetComponent<Animator>();
}
private void Start()
{
animator.Play(0, 0,Random.Range(0, animator.GetCurrentAnimatorStateInfo(0).length));
}
}