How to get a pathing enemy in 2D

Im making a 2D side scroller and im trying to get one enemy moving from point a to b but I can’t get anything to work. How to do I get my enemy to move between points?

Hi jaayvazian,

Do you need path finding for your enemies in 2D? Will they be chasing the player? Care to elaborate on your situation?


I would like to have the enemies move from point A to B then when the player is in range to attack the player.

Is something like this what you want?

Yes that is exactly something I would like to do.

That and have it attack

Anyone know how to do this?

I also need them to jump

Hey Jaayvazian, here is the project.

Its definitely not full proof, but should provide you with a start. If you need it to also attack. You could add another script to check for enemies, then stop moving once an enemy is close then face the target. How smart does your AI need to be to appear as an opponent?