enemy jumping over obstacles

So my platformer game’s enemies should jump over obstacles. I have created events for this but the events are not working?>

Hi :slight_smile:
1 - The obvious error is that the point name is “Centre” instead “Center” :wink:
2 - Not so obvious, but I think the second condition is impossible to meet, I hope to not be wrong, lets Thief.X to be “X” and Barrier.X to be “Y”, the system can’t be solved:

{X >= Y+200 ("concatenating")==> X >= Y+200 > X+200 ==> X > X+200 {X < Y (+200 in both hands)==> X+200 < Y+200
X > X+200 never fulfills.

Now it’s jumping every where!!!
Enemy Jump.png

Yes, Thief will jump everytime “LeftRight” is = 1 or = 2… Maybe you should put the actions to jump in the sub-events, as before? :slight_smile:

What are you trying to say with the second sub-event? Because you just modified the constants, but still is impossible to fulfill: You want Thief.X to be greater than X, and to be less than a number lower than X, at the same time :wink:

I think I am blind today!! But now they are not jumping at all, againg

Ok, can you send me an example with this problem?
Maybe the second sub-event conditions should be (per symmetry):

Thief.X >= Barrier.PointX(Centre) - 150 Thief.X < Barrier.PointX(Centre)

Ok here is the file
AI for enemy’s jumping.rar (188 KB)

I’ve to admit that it got me a little troubled for some minutes until I realized about the message of syntax error in the condition expressions, the expression was fine, so… I noticed that the object “Barrier” doesn’t exist, you forgot to rename the “NewObject” (maybe GD closed without saving) :laughing:
After rename the object, modify the second condition as suggested in my previous message, and adjust the constants a bit, it works perfectly, here is the .gdg file, just replace the old one to test:
AI for enemy Jumping.gdg (112 KB)

For some reason it is not working in the main scene!!! in the main project… Is there an alternative way.

Many things can be varying in your full project, so it’s difficult to say that an alternative way made in a simple example will work, as this example doesn’t work now :wink:
I would suggest to check what is working as in the example and what not, the Theif follow you but then doesn’t jump? If so, maybe the “LeftRight” variable of Theif is modified in some other place in the scene code, you should check it with the debugger. Check the expressions and search for syntax error messages, that could give you clues about an object name is misspelled.