How to make a character owned by an AI if he is AFK

Hi, I’m pretty new to UE and I’m looking to see if it’s possible to implement the possibility that when the player is AFK after a certain amount of time, he is automatically possessed by an AI and moves on his own following a behavior tree and after the player comes back, he can repossess the character as soon as he press any inputs.
I try this but i doesn’t work, i’m struggling with this for a week and i watch all possible tutorial about it, I figured out how I could switch between two characters by only controlling one while the other is possessed by the AI but since I only have one character it doesn’t seem to work or I am missing something

BP_Fps_Pawn

If someone can help me with that, it will be great, thanks

I am not sure how to accomplish this, however I believe it shouldn’t be too hard to achieve.

You can use this function: APawn::PossessedBy | Unreal Engine Documentation. In the behaviour tree, add a “Wait” task that waits for a certain amount of time (for example, 10 seconds) before executing the next task.

Thanks for the reply, i will check this out, it seems i have to get to understand a bit C++ and how implementing it to my project.