# How to make AI that remember player's actions and repeat them after some time

**URL:** <https://forums.unrealengine.com/t/how-to-make-ai-that-remember-players-actions-and-repeat-them-after-some-time/413577>\
**Category:** AI\
**Tags:** platformer, unreal-engine, Blueprint, question\
**Created:** [January 2, 2018, 12:09pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-that-remember-players-actions-and-repeat-them-after-some-time/413577 "2018-01-02T12:09:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![451F](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@451F](https://forums.unrealengine.com/u/451F)\
**Post date:** [January 2, 2018, 12:09pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-that-remember-players-actions-and-repeat-them-after-some-time/413577/1 "2018-01-02T12:09:40Z")

</div>

The idea is that player first time trying to complete the level perform some actions, then presses a button, and next time his copy repeats actions that player did last tries.

---

<div class="post-metadata">

**Author:** ![yanukadeneth99](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yanukadeneth99](https://forums.unrealengine.com/u/yanukadeneth99)\
**Post date:** [May 24, 2019, 7:07pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-that-remember-players-actions-and-repeat-them-after-some-time/413577/2 "2019-05-24T19:07:50Z")

</div>

If its like, limited to movement. You can make a 2D array of the movement direction (vector) and the time in delta (float) that the player holded that particular movement to save the actions, and then after the button, play that array on the AI.

---

<div class="post-metadata">

**Author:** ![WaxOff](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WaxOff](https://forums.unrealengine.com/u/WaxOff)\
**Post date:** [May 24, 2019, 8:41pm UTC](https://forums.unrealengine.com/t/how-to-make-ai-that-remember-players-actions-and-repeat-them-after-some-time/413577/3 "2019-05-24T20:41:10Z")

</div>

I’d do the same, only with storing a sequence of input + duration sets rather than movement direction & time in delta.   
  
Could be a bit simpler in practice - never tried it myself though.
