unity play animation once script code example Example: play animation through script unity animator.Play("StateName");