Ai tracking in paper 2d

Hi,

I’m making a beat em up game in paper 2d.
I made an AI you can track my character in the X axis but i need it to track the character also and Y axis.
Here is what I have so far:

Thank you for your help.

you’re overcomplicating what’s just a few simple vector operations.

here have some pseudocode, don’t actually make those variables, just drag the values between nodes, but drawing lines isn’t that easy in a text box :stuck_out_tongue:

vectorToPlayer = playerPosition - aiPosition
directionVector = vectorToPlayer / vectorLength(vectorToPlayer)
movementVector = directionVector * movementSpeed
setAiPosition(aiPosition + movementVector)