How to make a homing attack

Hi. I’ve been making a homing attack feature for my game but it doesn’t really work… I’m using homing projectile behavior to have the player move to the enemy. but It only moves the player when you hold the homing button! not only that but I don’t know how to re-enable the platformer behavior after I stop holding the x key. here’s my code:

could someone help?

Use an boolen object variable to indicate whether the player is locked on or not. Set it in the event in your screen shot, and create another event with a condition that checks if that boolean variable is true, and has the move projectile command as the action

ok! but im kindaa confused :confused:

What part is confusing or are you unsure about?

that part. (also sorry for late reply!)

Like this:

I finally did it! thanks for helping :smiley:
here’s my code: