I broke my slime ai

I was trying to add the slime actually jump towards you instead of sliding. But i was messing around my ai code to get it to work, i got the slime to jump but now it just wont move towards me. I cant seem to fix it, what can i do?

First of all don’t use extract other X. Pls fix that first

would you please evaluate to me how i could fully fix it instead of one thing

1 Like

You need to get the player’s x-y coords, then put them into a global variable, so you don’t need to extract anything.

then use that to make it to where the slime will go to.

k, gimme a sec, ill send an image of the desighn i messed with

1 Like

Do you know what quadratics is? bc you might need to know about it.

you got the picture yet?

*are

Also I don’t think you need to know, you can just use the physics engine

1 Like

yeah, but if you don’t understand it, then how can you hope to use it?

its more brokey now :frowning:

1 Like

1 Like

idk what i did but now it gets sent flying into the wall

1 Like

ok, are you using x-y coords or the game’s grid? that might be why,

x and y
but i dont need the y

1 Like

ok, and is the slime set to accepting x-y or the grid?

the thing is with the old movement was that it compared my coords and its coords, then it got a result that was -10 to 10 and if it was negative, it would go left, positive it would go right but now i think its using my exact coords which is like 300 so its garrentued to go right

1 Like

the 0,0 coords are at the top left of the screen, btw. you need to either set the global to the game’s grid, or change the rest of the code to get the x-y coords.