I can’t get this code to work. What I want to happen is that the warrior character cycles through his idle animation, then randomly does either the block or attack animations, then resume the cycle animation. This works with just the block animation but not with the attack animation code added.
One obvious thing here is tht you are using two different random values. So you have a fairly good chance of starting both animations - with the block animation coming out on top. Store the number in a variable and check it ony once.
Also you don’t want to use Update in this case, because it runs every frame. Use yield and coroutines instead. The logic would be better as if/else rather than two ifs:
if (Random.value > .9) {//do the first anim}
else {//do the other anim}