Top down character to AI on Idle state and back. HELP

Hi guys…

I am struggling to find any tutorial or information to solve this problem.
I am using unreal 5.1 top down character template. ( although i dont think it matters)

What i am trying to achieve is:

  1. After being in Idle state several seconds , or not receiving any input from player, I want my character to start being controlled by AI ( behavior tree ) so it goes roaming around

  2. After getting Input, such as left mouse click i want it to go back to being controlled by me

I am trying to achieve this using Blueprints. Please help if you know how to solve this. Send me Screen shot of event graph if possible.

Cool idea.

You could make logic to clear and rerun a timer whenever player input stops.
On user input, Clear Timer, Set Timer.
When the timer goes off it starts AI logic, and sets a boolean variable IsAIControlled=true.
When you give input again, check if IsAIControlled. If true, cancel AI logic and set to false.

You could use keyboard event Any Key. (also fires for mouse events)
On press: clear timer, check boolean and cancel AI logic.
On release: start timer.

:slight_smile: i actually solved the timer part, my issue is i dont know how to make my character start being controlled by AI. and then come back to my control after any click. could u help me ? im quite new to unreal. is there any tutorial that u know that can show that ? or photo of event graph i can see? :smiling_face: