Help me make a enemy that jumps when it gets under you please

I need a enemy in my game that, when it is right under you, will jump up to hit you and explode, someone please help me code this!!!

can you give me a link to your game?

sorry i forgot, link: http://www.flowlab.io/game/play/1168158

You could use a raycast to detect the player
OR
you could compare the players X-coordinates with the enemies X-coordinates

@JR 01 Hey, I tried to compare the X coords but I cant figure out exactly how, I tried a equation and a filter but that didnt work, or i didn’t do it right, can you send me a link to an example please?

-Pixel, Virtual Assistant

Just use an extractor for each character and get their x
Also try to use a less than < instead of equal = for filters because it could pass over it fast

If it’s the jumping when you start is the problem, then just let the once go to that extractor first before the timer starts

2019.05.21-15.57_01

@“JR 01” Thanks! But I already made it spawn so it looks like it jumps onto the screen, It looks pretty good.

Oh ok, so you got it working now?

@“JR 01” yes