Making a character fly - gets stuck at new location


I’ve set up this code for making my character enter fly mode. For now all I want is to make him get at 1000 units in the air and continue moving there. I always make my mechanics in an empty project and then redo them in my main and in my third person template test it worked really fine but after doing the same code in my main project my character gets stuck, stays there for a few seconds THEN falls back down. After this initial fail if I trigger the fly it works smooth. But the first try is always jammed. Any ideas where should I look?

Figured it out. It was from the Timeline. I was not using Use Last Keyframe, so the timeline was longer than needed.