# Animation Blueprint - how to randomly play anim?

**URL:** <https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941>\
**Category:** Character & Animation\
**Tags:** random, unreal-engine, question\
**Created:** [June 28, 2014, 11:24am UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941 "2014-06-28T11:24:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![intoxicat3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@intoxicat3](https://forums.unrealengine.com/u/intoxicat3)\
**Post date:** [June 28, 2014, 11:24am UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/1 "2014-06-28T11:24:22Z")

</div>

I’ve an couple of Attack animations and I don’t know which is the best way to randomly play them when character is attacking. I can’t find any random node in Animation Blueprint. Anyone can point me out?

The functionality here would be really simple - when character is in some state he will start attacking and just picking attacks.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [June 28, 2014, 1:42pm UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/2 "2014-06-28T13:42:15Z")

</div>

Use switch on int and input random int

---

<div class="post-metadata">

**Author:** ![intoxicat3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@intoxicat3](https://forums.unrealengine.com/u/intoxicat3)\
**Post date:** [June 28, 2014, 2:51pm UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/3 "2014-06-28T14:51:38Z")

</div>

can’t do that in animation blueprint.

---

<div class="post-metadata">

**Author:** ![Albert\_Espin\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Albert\_Espin\_1](https://forums.unrealengine.com/u/Albert_Espin_1)\
**Post date:** [June 28, 2014, 3:21pm UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/4 "2014-06-28T15:21:19Z")

</div>

Just get a random int in your character blueprint, save that into a variable there, then in AnimBP’s EventGraph use something like “Get Player Character”, cast to your character BP, get the variable and set another int variable in your AnimBP to hold that random int value, and depending on it play one or another animation.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [June 28, 2014, 3:35pm UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/5 "2014-06-28T15:35:13Z")

</div>

You can call Anim Blueprint from other Blueprint using Get Anim Instance ;]

---

<div class="post-metadata">

**Author:** ![Maelgrim](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maelgrim/32/1096223_2.png) [@Maelgrim](https://forums.unrealengine.com/u/Maelgrim)\
**Post date:** [December 30, 2015, 11:07pm UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/6 "2015-12-30T23:07:25Z")

</div>

Make a structure with all of your animations, make a variable in your player blueprint of that structure, get that variable and break it, connect each of your pins (your montages) to a select utility, get a random integer from range that is the same as your number of pins, and feed that select node to your play montage, wala!

---

<div class="post-metadata">

**Author:** ![Neil\_London](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/neil_london/32/1104110_2.png) [@Neil\_London](https://forums.unrealengine.com/u/Neil_London)\
**Post date:** [September 5, 2017, 2:11pm UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/7 "2017-09-05T14:11:45Z")

</div>

I know this is a really old post and I posted this in a different feed but I figured I’d share what i found worked for since I stumbled across this thread looking for answers. I created a bunch of animation Montages based on Death animations (6 total). I wanted each death to be unique so I made a variable made it an array and called it Death Montage and set it to Anim Montage. I then added all the death anim montages into the array. I then told it to Get the array and grab a random integer and pumped the get into the Play Anim Montage. Now when I kill a bad guy they die 1 of 6 ways.  
I hope this help anyone having trouble with this.

Alternatively you can create an animation Montage and after setting that up you can call on it with a button input.

 ![212347-capture-2017-09-05-07-04-20-366.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/d/3/9d3e34555e507c87a5c105e499a3459d9a96ef2d.png)

---

<div class="post-metadata">

**Author:** ![Bluemaze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bluemaze](https://forums.unrealengine.com/u/Bluemaze)\
**Post date:** [June 16, 2024, 4:17am UTC](https://forums.unrealengine.com/t/animation-blueprint-how-to-randomly-play-anim/286941/8 "2024-06-16T04:17:57Z")

</div>

Mine is similar but also randomizes the play rate and start position within the ABP

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/9/d599b6d69154a707348bca6b2a12d3d3ed989017.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/8/d08aab542302474fc5237563eaad36d5937f9a99.png)
