2D Sidescroller enemy AI jump help! Picture Included!

Hello everyone. I’m learning Unity and this is my very first project.

I have a 2d side scroller with a player and an enemy AI.

The enemy AI targets the player and can follow the player and flip directions as needed.

my question is how can I get this AI to jump to the platform the player does in order to continue following the player?

I’ve read things about waypoints, navmesh, triggers, ect ect. The problem is I don’t know what they all can do and like I said I’m very new so a tutorial would be amazing!

dude I give you an easy solution :). place a box collider 2d on the ground. then if enemy is in the boxcollider that is on the ground and the player is in the boxcollider that is top of the ground,then enemy shold jump :).you can use OnTriggerEnter2D function and it’s very easy .hope it gives you some ideas :smiley:

How would you link both box colliders? I understand if the AI enters the first one then jump, but how would you script if ai is in bottom 2dcollider and player is in top 2dcollider then jump?

Its a fine idea to do 2dTriggers and its not wrong but i would use a ray cast. it’s not that compleceted to lern and it is so importent for unity i use it in one way or anather in evre game i make.
you culd chack the distance with the ray and tell him to jump at a certain point, this way you dont need to manually position every jump point.

heres the link for 2d ray casting: Unity - Scripting API: Physics2D.Raycast