I want a 2D enemy AI that will follow the player and jump onto platforms. After lots of googling, I haven’t found much if anything at all. I don’t just want an ai the moves towards the player and jumps if a raycast hits or doesn’t hit something, I want something like A* implemented. Can someone help me understand how I need to code it
first, look if the player’s position in the x is greater or smaller than the enemy’s to make the enemy look in the good direction.
next, make it translate by something like 0.05f in the x axis.
then use raycasts to see if he is on the side of a platform to make it jump.
use Addforce in the y axis to make it jump.
add a tag in the editor so it’s easier for the player to detect a collision with it.
and of course add a collider and rigidbody to the enemy.