2D Sphere chase AI

Hey I was trying some stuff with spheres and stuff I tried to make an Sphere npc that chases and hits player(Not like damaging but pushing) which is also a sphere I tried so many times but in most of them sphere either moves like a cube or just acts weird there are no obstacles in the way but AI acts weird can one of you give me a sphere chase AI please (Also by 2D I mean only 2 possible movements like left and right it is not excatly 2D)

Asking for finished scripts is not the way to go.

Adding force in the direction of the player would solve this. Thinking ahead of time would probably create much better effect ( where will player be after 1 s etc… )

How can I do that ? I mean applying the force where the player will be 1 sec after.

Simple formula: d = vt where d is distance v is velocity and t is time. With this formula you can get the player position after t seconds, the only downside is that he can change his velocity.

Edit: sorry d is not the distance but rather displacement ( I don’t why I wrote distance )

Since I didn’t have anything else to do and I’am so nice :smile: , I did a quick video on how to achieve something like that:

Lel Thanks so much mate.

1 Like

Well I hope that helped you, but I didn’t explain it so I hope you can understand what’s going on.

I’m more into javasciript but I still understood thanks mate.