The Object jumps when its not supposed to

Hi mates. I was making Enemy for my project. I wanted it to jump in front of obstacles, cliffs and other stuff. I successfully made the AI jump over obstacles but I am having a hard time on cliffs. I did this to jump over obstacles and its working

But jumping over cliffs doesn’t work. I am using this event to jump over my cliff.


Does inverting the Point inside an object condition check if the Point isn’t inside the object or does something else?

The problem isn’t that it doesn’t jump but the problem is that it jumps even when the point is inside the Platform.

I still can’t figure out why it doesn’t work. These are my events.


and my points

My Enemy is 32x32
@MrMen @UlisesFreitas Tagging for your attention :sweat_smile:

This is due to the fact that we have multiple instances of the platform at the level. And the check occurs on all instances and it happens so that the point is not included in any one of the instances. I suppose it is necessary to loop through all the instances and check that it does not intersect with any platform.

Update:
I also used the Flip function for the enemy, so as not to create unnecessary points. The only thing left is the jump while at the edge of the platform. This can be fixed by setting the points a little differently (I used your settings):

jump_enemy

No need to loop, simply put it in an “Not” event :wink:

I’m doing something wrong because it doesn’t work for me:

Huh. I don’t have any more time rn sadly but I’ll check this later, afaik this should work.

I throw off my test project with both options so as not to create a new one:
enemy_ai_jump.zip

Update:
I believe that there is the same problem here, that the check occurs for all instances and some one does not match the conditions (you use the “Not” or invert event).

A little more thought:
I think the problem with the definition of “abyss” can be solved with the help of RayCast, which will be directed downward. If the platform is found, then the character does not need to jump. In this case, the point is not needed and this is a more universal solution (no loop is needed, since RayCast will check for concatenation with a specific instance).

Update:

Updated the archive, adding a check with RayCast there: enemy_ai_jump.zip

jump_enemy_2

That’s absolutely not what should happen. The invert inverts the condition, so it triggers if any platform is not touching the point. The not takes the result from the condition, which is true as long as one platform touches the point, and inverts it, making it only trigger if all platforms are not touching the point.

I know that this works as i have used this difference many times.

Umm



It doesn’t work even with Repeat For Each Instance event.

I invert the condition.

Lets use that and see.

@arthuro555 Hmm. Does that mean using Not condition only performs the action only if that condition inside the Not condition is False (isn’t happening)?

I added a variable to write a negative result if the platform overlaps. You just go over all the instances and when it does not intersect, you jump.

Unfortunately, I can’t. I hope you can give an example.

Doing something like that doesn’t help as well. Looks like my best bet would be to use a Raycast (but I’m gonna look at your Example aka Project aka archive)

It’s strange, because it works for me. I introduced the variable (is_abyss), set its value to True. Now, in a loop, I check the intersection of the platform instance and the specified point, if there is an intersection, then set the value to False. Next, we check the value of the variable, if it is True (no intersections), then we jump.
In the shown your code (as I already said), you did not use a variable and the condition for intersection in the loop is inverted.

Oh yah. Then why it didn’t work?

  • Cause the Code was Possessed by a Trigger Once

LOL. It was all because of a single Trigger Once. Thanks @E1e5en for helping.

1 Like

I looked into it, and it seems the not is broken for conditions that use automatic object selection. When I had used this technique, it was with conditions that do manual picking (for example cursor on object condition). I’ll report it on GitHub.

1 Like

Most surely it was tried before, but how about invisible objects put where you need the enemy (or enemies) to jump so when the it (them) collide with said object, you simulate the jump key press.

It’s also a good idea but it (might) cause a performance drop if we have many places we want the Enemy to jump onto.
Also using other methods (instead of the same is on collision then do something method) will teach us about many different situations where we can use that condition to make our work easier and faster and reduce lags
Et Cetra Et Cetera.

And at last, why not use the features of GDevelop to their fullest?

1 Like